David Fanning writes:
> Oh, dear. Hold off on this for a few minutes longer.
> I've done this incorrectly for one thing. But TVImage
> is *much* more difficult to handle than other routines,
> primarily because it doesn't erase itself (it acts like
> the TV command).
OK, I think this is done correctly now. You can download
the update here:
http://www.idlcoyote.com/programs/tvimage.pro
The problem is that TVImage acts like the TV command
and doesn't erase itself. This is a problem in resizeable
graphics windows, obviously. And yet, it is one of the
very nice features of the TV command, too. It makes it
possible to use images along with other graphics commands.
So, here is how this works. I want to maintain the idea
of working with FSC_Windows just like you work with
other IDL graphics windows. So, if you want to display
an image, you can simply set the Window keyword as you
normally would:
IDL> TVImage, image, /KEEP_ASPECT, MARGIN=0.1, /WINDOW,
This will automatically set the ERASEIT keyword, so that
when the window is resized, only the image appears, not
left-over garbage from the previous display.
Similarly, if you have a plot in the window:
IDL> FSC_Plot, Loaddata(1), /WINDOW
And you issue the TVImage command:
IDL> TVImage, image, /KEEP_ASPECT, MARGIN=0.1, /WINDOW
The image will take the place of the plot command in
the window, as other commands do. The ERASEIT keyword
is also set.
But, if you want to add an image to a display, you don't
set the WINDOW keyword, but rather the ADDCMD keyword.
This automatically sets the WINDOW keyword for you, but
it also sets the ERASEIT keyword to 0 and *adds* the command
to the FSC_Window, rather than replacing the commands that
are already there.
IDL> FSC_Plot, Loaddata(1), /Window
IDL> TVImage, image, /KEEP_ASPECT, MARGIN=0.3, /ADDCMD
In this case the image appears with the plot, and both
resize together.
Unfortunately, if you try to add a command to an FSC_Window
when an FSC_Window doesn't exist, you thrown an error. So,
you have to be a bit careful about which keyword you use.
I can't get out of this box without some VERY ugly code, so
I'm going to think about this some more. In the meantime, just
use the keywords as they are supposed to be used. ;-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|