|
Re: How to make the figure change automatically while I selected a new color table? [message #61039 is a reply to message #61037] |
Thu, 26 June 2008 20:21  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
duxiyu@gmail.com writes:
> I have a problem about using the color table.
>
> For example,
>
> device, decomposed=0
> loadct, 0
> tvscl, dist(256)
> xloadct
>
> While I changing the color table in the dialog box 'XLoadct', I hope
> the color of the figure can change automatically.
> Some files said that when IDL run in the pseudocolor mode (8-bit
> mode), the figure can change automatically.
> But my system is Windows, I have search in the help and do not find
> how to change the the visual moed to pseudocolor.
> The keyword 'PSEUDO_COLOR' can only be used in 'X-window' system.
Here is how to do this on a 24-bit display. This comes from the
header information in XCOLORS:
http://www.dfanning.com/programs/xcolors.pro
Write a small routine line this:
PRO REFRESH_IMAGE, Image=image, _Extra=extra, WID=wid
IF N_Elements(wid) NE 0 THEN WSet, wid
TVIMAGE, image, _Extra=extra
END
Invoke the routine like this:
IDL> Window, /Free
IDL> TVImage, image, Position=[0.2, 0.2, 0.8, 0.8]
IDL> XColors, NotifyPro='Refresh_Image', Image=image, WID=!D.Window
Now, when you can the color table, the image will be automatically
updated in the window.
There are similar, if slightly less flexible, mechanisms
available for XLOADCT.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|