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

Home » Public Forums » archive » Re: How to draw a line on an image?
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: How to draw a line on an image? [message #5652] Wed, 31 January 1996 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
yoshida@fermi.bsd.uchicago.edu (Hiro Yoshida) wrote:
>
> Hello IDL experts,
>
> Is there a handy way to draw lines on an image in IDL?
>
> I would like to draw some simple graphics such as lines, boxes, and circles
> on an image. (I am not talking about modifying image itself by putting
> white pixels to draw these figures.) I believe that IDL has some commands
> for this type of "overlay" task. Unfortunately, however, I cannot find one
> so far.

You might try using the normal drawing routines, like PLOT, OPLOT
and PLOTS, but set the graphics mode to XOR (exclusive-or) mode
like the following:

< xarray and yarray are integer arrays of coordinates >

wset, current_window
device, get_graphics = oldg, set_graphics = 6
plots, xarray, yarray, /device

This "draws" the lines on your image by XOR'ing all pixels. What
you get is usually not one continuous color, depending on the
contents of the image, but it may be workable. You can then
"undraw" the lines and restore the original image with:

plots, xarray, yarray, /device
device, set_graphics = oldg

Usually you will also want to restore the original graphics mode,
since most drawing operations are done using a different mode.

Hope this helps.

Dave Foster
UCSD Brain Image Analysis Lab
foster@bial1.ucsd.edu
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Random # generator?
Next Topic: Re: Problem addressing arrays from C routines running OSF

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

Current Time: Wed Oct 08 15:05:50 PDT 2025

Total time taken to generate the page: 0.00603 seconds