Screen dump to file - color problems [message #35795] |
Wed, 16 July 2003 10:59 |
Richard French
Messages: 173 Registered: December 2000
|
Senior Member |
|
|
I'm running IDL5.6 on a Mac and I'm having trouble getting a screen dump of
a color image to a file - the colors are not working properly. I've tried
using David Fanning's TVREAD(), I've tried FSC_WINDOW, and I've tried every
combination of decomposed=0, decomposed=1, TRUE=1, TRUE=0, etc with no
success. Two symptoms - the background color of the window was supposed to
be white, but it ends up being blue; the color table for the image itself
seemsm to be wrapped over itself.
Can someone help save my sanity? Here is what fails on my Mac running OS
10.2 and X11 Beta 3 - XFree86 4.2.1
IDL> help,/dev
Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
Current graphics device: X
Server: X11.0, The XFree86 Project, Inc, Release 40201000
Display Depth, Size: 24 bits, (2560,1024)
Visual Class: TrueColor (4)
Bits Per RGB: 8 (8/8/8)
Physical Color Map Entries (Emulated / Actual): 256 / 256
Colormap: Shared, 16777216 colors. Translation table: Enabled
Graphics pixels: Combined, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Req from Server.
IDL> print,!version
{ ppc darwin unix Mac OS X 5.6 Oct 26 2002 32 32}
I tried just doing the actual TVRD() commands, following what is in the guts
of David Fanning's TVREAD:
Device,decomposed=0 ; for the display of the image
Loadct,3
Window,xsize=400,ysize=400
Erase,color=255 ; make white background
Tvscl,dist(300),50,50
Device,decomposed=1
Result=tvrd(/TRUE)
Write_jpeg,'tryit.jpg',result,/TRUE
Device,decomposed=0
When I display the jpeg file, I get a blue background and a green diamond in
the middle of the image.
I'm willing to admit that I am blind and stupid! I'm using code that seems
to have worked last year on whatever machine I might have been using, but I
can't get it to work now, and it is driving me crazy.
Thanks for any hints.
Dick French
|
|
|