# Measures On Two Clicks

**URL:** <https://forum.kirupa.com/t/measures-on-two-clicks/119336>\
**Category:** Uncategorized\
**Created:** [August 13, 2004, 4:10pm UTC](https://forum.kirupa.com/t/measures-on-two-clicks/119336 "2004-08-13T16:10:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thesignx](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thesignx](https://forum.kirupa.com/u/thesignx)\
**Post date:** [August 13, 2004, 4:10pm UTC](https://forum.kirupa.com/t/measures-on-two-clicks/119336/1 "2004-08-13T16:10:57Z")

</div>

Hi ther all of you…

Does any one got any idea how to do something like…

Imagine you got a picture of a golf course and the user likes to know the distance from one point to another!

Can it be like… when the user cliks once (starting point) then drag the cursor to any direction on the image (can a line be drawn from the sarting point to the mouse position) when the cursos is in movement the distance has to be updated in a text field.

Another thing is that at the beggining I have to setup the scale of the image, no?.. for example how to convert pixels to yards, since the distance information that the user gets have to be in yards…

ANY IDEA!!! :A+:

---

<div class="post-metadata">

**Author:** ![Jeff\_Wheeler](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jeff\_Wheeler](https://forum.kirupa.com/u/Jeff_Wheeler)\
**Post date:** [August 13, 2004, 4:16pm UTC](https://forum.kirupa.com/t/measures-on-two-clicks/119336/2 "2004-08-13T16:16:00Z")

</div>

to get the line drawn you could set a variable called xclick and yclick, and then use the drawing api to draw between that and xmouse and ymouse… too do the scaling you could simply do the math, like yard\_distance=distance\*1.3; and then append yards to the end of that value… oh and to make sure it stops on release, you could have the drawing api stuff in an onclick function, and then delete that on an onrelease function 😉

---

<div class="post-metadata">

**Author:** ![thesignx](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thesignx](https://forum.kirupa.com/u/thesignx)\
**Post date:** [August 13, 2004, 4:31pm UTC](https://forum.kirupa.com/t/measures-on-two-clicks/119336/3 "2004-08-13T16:31:09Z")

</div>

Ok, let me do some experiments… Thanks BP

---

<div class="post-metadata">

**Author:** ![Jeff\_Wheeler](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jeff\_Wheeler](https://forum.kirupa.com/u/Jeff_Wheeler)\
**Post date:** [August 13, 2004, 4:37pm UTC](https://forum.kirupa.com/t/measures-on-two-clicks/119336/4 "2004-08-13T16:37:39Z")

</div>

np 😉
