comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » X and tvrd color scaling problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
X and tvrd color scaling problem [message #37534] Mon, 05 January 2004 20:39 Go to next message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
I'm having a strange problem with tvrd(). When using the Z buffer
everything behaves as I expect. However, when using X tvrd() doesn't
seem to scale the colors correctly.

For an example, I created a new window and added a colorbar. In the
window, everything looks normal. But, if I grab the image with tvrd()
and then immediately display it with tv, the colors get scaled
incorrectly and there's a lot of white which is index 255 of the color
table I'm using.

; create a window and a colorbar (a la Coyote)
device, DECOMPOSE = 0
loadct, 39
window, XSIZE = 400, YSIZE = 400
colorbar, format = '(A1)'

; everything looks normal so far...
; grab the image and display it with tv
image = tvrd()
tv, image

; what happened?! the scaling is funky and there's a lot of white!


However, if I use the Z buffer, everything behaves as I expect.

; create an image and a colorbar (a la Coyote)
device, DECOMPOSE = 0
loadct, 39
set_plot, 'Z', /COPY
device, SET_RESOLUTION = [400, 400]
colorbar, format = '(A1)'

; grab the image and switch back to X to display it
image = tvrd()
set_plot, 'X'
window, XSIZE = 400, YSIZE = 400
tv, image

; the image looks normal and there's no weird scaling


What gives? Why doesn't the X method capture the image correctly?

Mike
Re: X and tvrd color scaling problem [message #38734 is a reply to message #37534] Fri, 26 March 2004 08:53 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Alvin writes:

> I have a different problem. I can't capture the color white from a window
> using tvread. Every other color works fine but after I redisplay the
> captured image, the white is all messed up!
> Any idea?

Here is an article that might help:

http://www.dfanning.com/color_tips/gif_gray.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Transparent IDLgrImage ?
Next Topic: Re: how to create an upgradeable txt or other file as output

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 16:53:29 PDT 2025

Total time taken to generate the page: 0.40289 seconds