on 9/21/04 3:21 PM, Terry at [EMAIL PROTECTED] wrote:

> Robert Moynihan at [EMAIL PROTECTED] wrote:
> 
>> Terry, you didn't mention trying 'nativeFormat'?  Bob.
>> 
>> Terry wrote:
>> 
>>> I have a bitmap that is 4 bit with a color table. It draws perfectly into
>>> the main screen. But, when I try to draw it to an offscreen window (and copy
>>> it back to the main screen) it converts it to a grayscale image. Why? I
>>> tried creating the image with screenFormat and genericFormat and they both
>>> behaved the same.
>>> 
>>> It acts like it is ignoring the color table in the bitmap.
>>> 
>>> This is using POSE with the color OS 3.5 ROMs.
>>> 
>>> Thanks,
>>> Terry
> 
> 
> Thanks for the suggestion. I tried nativeFormat too. They all looked the
> same as far as I could tell with my eyes.
> 
> After I draw the bitmap to the offscreen window, I also draw some blue
> rectangles (which are supposed to match the blue in the bitmap), and they
> show up as blue! But, the bitmap is all gray. So, the offscreen window is
> capable of colors.

I had to change it to use WinCreateBitmapWindow with a bitmap that has a
matching color table to the bitmap I was trying to draw. Drawing into the
offscreen window causes no color matching to occur (as with any offscreen
window, apparently). Since now the offscreen window's bitmap has a color
table, when I finally blit it to the main screen, THEN it does the color
matching correctly.

Creating a window with WinCreateOffscreenWindow creates a window with a
bitmap that has no color table, which means there is no color matching (or
only the default color matching) when you call WinCopyRectangle.

This is documented in the API Reference in the description of WinScreenMode.
<http://www.palmos.com/dev/support/docs/palmos/Window.html#1015990>

Terry




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to