comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: drawing lines interactively
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: drawing lines interactively [message #30536 is a reply to message #30528] Fri, 03 May 2002 14:51 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Marten Blixt (maarten@blues.phys.uit.no) writes:

> I have a small problem which I've solved only partially.
>
> I would like to draw a line on an image using the mouse, by clicking on the
> two end points.
> Sofar I can do just that, by using
> TV,testimage,TRUE=1
> CURSOR, x0,y0,/DEVICE,/DOWN
> CURSOR,x1,y1,/DEVICE,/DOWN
> PLOT,[x0,x1],[y0,y1], /DATA,/NOERASE
>
> but then the line appears *after* the two endpoints have been choosen, and I
> would like a "temporary line", between the first point and the current position
> of the cursor, to be shown. This should help me in positioning the last point.
>
> There is probably a simple solution to this, I just haven't found it. Does any
> of you know how?

You can see a fairly simple solution to this in the program
Drawline. Use your left mouse button to draw a freehand line,
or your right mouse button to draw a straight line.

http://www.dfanning.com/tip_examples/drawline.pro

You can also read the following tip:

http://www.dfanning.com/widget_tips/line_on_image.html


Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Findfile finds no files
Next Topic: Re: color bar..

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:54:39 PDT 2025

Total time taken to generate the page: 1.20045 seconds