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

Home » Public Forums » archive » Color BMP problems
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
Color BMP problems [message #11290] Sat, 28 March 1998 00:00 Go to next message
James Fulton is currently offline  James Fulton
Messages: 2
Registered: March 1998
Junior Member
I use the following lines to make a bitmap file of the active window and the
resulting file seems to have different colors from the original when I view
the file.

TVLCT, R, G, B, /GET
image = TVRD()
WRITE_BMP, 'temp.bmp', image, R, G, B

I am using Win95 with the screen set at 16 bits. I am also using the
supplied color files that comes with IDL. Any ideas why?
Re: Color BMP problems [message #11507 is a reply to message #11290] Wed, 01 April 1998 00:00 Go to previous message
dwc is currently offline  dwc
Messages: 2
Registered: April 1998
Junior Member
In article <6fjn2o$6kh$1@sienna.impulse.net>, jfulton@impulse.net says...
>
> I use the following lines to make a bitmap file of the active window and the
> resulting file seems to have different colors from the original when I view
> the file.
>
> TVLCT, R, G, B, /GET
> image = TVRD()
> WRITE_BMP, 'temp.bmp', image, R, G, B
>
> I am using Win95 with the screen set at 16 bits. I am also using the
> supplied color files that comes with IDL. Any ideas why?
>

This may be due to the Microsoft primary ordering which is BGR not RGB. The
following code works fine on 16bit/24bit displays under Win95:

save_bmp = 'foobar.bmp'
bmp_image = TVRD(/TRUE)
; change from RGB to BGR for .BMP
chan_temp = bmp_image[0,*,*]
bmp_image[0,*,*] = bmp_image[2,*,*]
bmp_image[2,*,*] = chan_temp
write_bmp, save_bmp, TEMPORARY(bmp_image)

I have found that Truecolor graphics work great under 5.0.2 - I avoid using
color tables and color indexes as much as possible.

Dave Coulter
dwc@nel.newmont.com
Re: Color BMP problems [message #11511 is a reply to message #11290] Tue, 31 March 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Dave Coulter (dwc@nel.newmont.com) writes:

> This may be due to the Microsoft primary ordering which is BGR not RGB. The
> following code works fine on 16bit/24bit displays under Win95:
>
> save_bmp = 'foobar.bmp'
> bmp_image = TVRD(/TRUE)
> ; change from RGB to BGR for .BMP
> chan_temp = bmp_image[0,*,*]
> bmp_image[0,*,*] = bmp_image[2,*,*]
> bmp_image[2,*,*] = chan_temp
> write_bmp, save_bmp, TEMPORARY(bmp_image)
>
> I have found that Truecolor graphics work great under 5.0.2 - I avoid using
> color tables and color indexes as much as possible.

Now HERE is something I didn't know and wouldn't have figured
out in a long, long time!

Thanks, Dave.

Cheers,

David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
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: PV-Wave, Fortran & Windows NT
Next Topic: Re: Calling fortran procedures from IDL

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

Current Time: Wed Oct 08 18:13:35 PDT 2025

Total time taken to generate the page: 0.00569 seconds