[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can't change colortable in current window (linux bpp24)



Olivier ARCHER wrote:
> when i load a color table with loadct *after* opening a window, nothing
> happen. here a piece of code producing the error:
> 
> device,decompose=0
> window,/free && tv,dist(400)  ;; picture in B/W
> loadct,4                      ;; this have no effect in the current
> window ( no error messages )
> window,/free && tv,dist(400)  ;; picture in color; loadct effect...
> 
> this fail on a linux rh6 , with dpyinfo saying that my X serveur is
> TrueColor, with 24 plane depth
> this work on solaris( creator 3D graphics card) , with dpyinfo saying
> that my X serveur support various combination of class/depth.

Olivier,

The behavior you describe is actually a *feature* of 24-bit TrueColor
mode in IDL. You can certainly do a lot of neat stuff in 24-bit mode, as
described David's excellent articles. A quick way around this problem in
24-bit mode is to always load the color table just before displaying the
image, e.g.

loadct, 4
tvscl, dist(256)

However if you really *want* all of your graphics displays to update
automatically any time you change the color table (using LOADCT,
XLOADCT, or TVLCT), *and* you don't mind the limitations of 8-bit
PseudoColor mode in IDL, then type the following commands just after
starting a new IDL session:

device, pseudo=8, decomposed=0, retain=2   ; select PseudoColor mode
window, /free, /pixmap    ; lock this mode by opening a window
wdelete, !d.window

PseudoColor mode will then be locked in for the rest of the IDL session
(you can't change modes once you've created a graphics window). To check
that you actually got PseudoColor mode:

device, get_visual_name=mode
print, mode

If you want to change back to TrueColor mode in future IDL sessions,
replace 'pseudo=8' with 'true=24'. These commands are best placed in an
IDL startup file. Type

? startup

in IDL to find out how to use a startup file.

Cheers,
Liam.

-- 
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley