Re: linetool for measuring the distance between 2 points [message #40775] |
Thu, 26 August 2004 08:43 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Tobi writes:
> i have a widget application which will display data as an image. i
> would like to draw a line and measure the distance between the start
> and end points. i can get the position from two cursor calls and then
> calculate it, but i was wondering if there is an easier way?!
Cursor calls!? In a widget program? Oh, my goodness. :-(
Have a look at how to draw an interactive rubberband line
in a draw widget:
http://www.dfanning.com/widget_tips/line_on_image.html
(Use your RIGHT button to draw the line in the Drawline
example program.)
Then, just calculate the distance between the end points
and output it someplace. :-)
Cheers,
David
P.S. Let's just say the kind of interaction you get
from CURSOR is not what widget programs are all about. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|