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

Home » Public Forums » archive » Re: color problem when capture the object window
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: color problem when capture the object window [message #38560] Mon, 15 March 2004 09:00 Go to previous message
lius02 is currently offline  lius02
Messages: 6
Registered: November 2003
Junior Member
David Fanning <david@dfanning.com> wrote in message news:<MPG.1abb9f5a579700e29896ff@news.frii.com>...
> Songtao Liu writes:
>
>> I write the captured screen images to a bmp file and when I look at
>> the bmp file, I found the color is not what it looks like on the
>> screen.
>>
>> It is just a simple widget program, with several object graphic
>> windows, each display an image and ROIs(draw with plot object).
>>
>> Followings are the codes to capture the screen display and write them
>> to the disk
>>
>> ;capture the window display
>> draw_id -> getProperty, image_data = data
>> ;write to file
>> write_bmp, filename, data
>
> Oh, right. For some reason, when you create 24-bit color BMP
> files, Microsoft wants them in the form of BGR rather than RGB.
> (Don't ask me, I don't have the foggiest idea.)
>
> So just flip your red and blue image planes and you will
> be good to go. I typically avoid this problem by writing
> 8-bit BMP files with color tables. See my XImage program,
> for example.
>
> Cheers,
>
> David

Dear Dr. Fanning,

Thank you very much for your instruction. After reading your Ximage
program, I figured out that I missed the line:

image2D = color_quan(snapshot, 1, r, g, b)

now the captured picture is exactly the same as they are shown on the
screen.

Thanks again and have a terrrrrific nice day!

Songtao
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Announcing GDL 0.7, now with PLOT command
Next Topic: Poisson eq solver?

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

Current Time: Sun Oct 12 14:11:53 PDT 2025

Total time taken to generate the page: 1.28440 seconds