TVRD, Decomposed = ? and 24bit display [message #30259] |
Fri, 12 April 2002 02:15  |
maarten
Messages: 30 Registered: April 2002
|
Member |
|
|
Hi all,
I'm new to this newsgroup, but been working with IDL for a while.
My problems relates to getting nice output (in form of png files) from
my IDL sessions.
I'm using IDL 5.5 on Macintosh, with a TrueColor 32 bits, visual class
and depth.
I'm plotting a gray-scale image (ImageData) together with some colored
contour plots (ColorData) in a graphics window, and I whish to put the
result in a png file.
To get good-looking result in my window I must use DEVICE, Decomposed = 1
But then my TVRD results looks completely messed up!
When I use DEVICE, Decomposed = 0, the colortables doesn't work, and all I get
is red colors, but the TVRD output looks exactly as in the window.
It must be possible to handle the color tables correctly AND get nice output
from TVRD - but my question is: how?
Maybe I don't even need to use TVRD to store the output?
Grateful for any help!
M�rten
An example code looks something like
;--------------------CODE----------------------------
Device, Decomposed = 1 ;Tried with Decomposed = 0, but then I
;can't reproduce any sensible data from TVRD
; Create a "split" colortable
ncolors = 2.^8
LoadCT,0, NCOLORS=ncolors/2,BOTTOM=0 ;BW colorscale
LoadCT,5, NCOLORS=ncolors/2,BOTTOM=ncolors/2 ;Colorscale
ColorData = ...... ;Array of data
ImageData = ...... ;Array contaning BW image
; Scale data so that it fits into the two different parts of the colortable
ColorData = BYTSCL(ColorData,TOP=ncolors/2.-1)+BYTE(ncolors/2.)
ImageData = BYTSCL(ImageData,TOP=ncolors/2.-1)
; Display the data
CONTOUR, ColorData,/CELL_FILL, C_COLORS=INDGEN(25)*5+ncolors/2.,$
.... ;+Alot of positioning commands'
TV, ImageData, .... ;+ Alot of positioning commands
; Save window to file
screendump = TVRD(True=1)
WRITE_PNG,'filame.png',screendump
;------------------END CODE--------------------------------
|
|
|