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

Home » Public Forums » archive » Re: Quickly Erasing lines on direct graphics images
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: Quickly Erasing lines on direct graphics images [message #46265 is a reply to message #46264] Sat, 12 November 2005 14:22 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

> Richard G. French writes:
>
>> I have a Direct Graphics question. How can I quickly erase lines that I have
>> drawn in displayed images?
>
> The standard way to do this kind of "quick erasing" is
> to use a pixmap and the "Device Copy" technique.

Participants in my class this week wrote a pixmap object
that proved extremely useful. I've made it available here:

ftp://ftp.dfanning.com/pub/dfanning/outgoing/misc/pixmap__de fine.pro

To create a pixmap with an X size of 300 and a Y size
of 400 pixels, you do this:

pixmap = Obj_New('pixmap', XSize=300, YSize=400)

Given that you have something in IDL graphics window
2 that you want to copy to a pixmap, you would do this:

pixmap -> CopyToPixmap, 2

Or, you can simply draw graphics in the pixmap:

pixmap -> SetWindow
Plot, findgen(11) ; etc.

To copy to a window, say window index number 3:

pixmap -> CopyToWindow, 3

If you wish to make the pixmap a different size (for
example, in a resizeable graphics window application):

pixmap -> Resize, newXsize, newYsize

But, best of all, if you want to see what you actually
have in the pixmap (i.e., so you can debug your program):

pixmap -> Map, 1

To hide it again:

pixmap -> Map, 0

Be sure to destroy it when you are done. If it is
mapped, you can destroy it with your mouse. If not,
you must do it like this:

Obj_Destroy, pixmap

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: subscripting arrays with dim > 1
Next Topic: make .dll share image file for CALL_EXTERNAL

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

Current Time: Fri Oct 10 15:32:35 PDT 2025

Total time taken to generate the page: 1.28304 seconds