"Jake" == Jake Donham <[EMAIL PROTECTED]> mentions:

    Jake> Hi, I'm having a problem where color operations on an
    Jake> offscreen window sometimes don't take effect, and things are
    Jake> drawn in the wrong color. When I run my app on a debug rom
    Jake> (e.g. 3.5.1) it gives me an error saying that the bitmap
    Jake> lacks a color table when trying to call WinIndexToRGB.

We tracked this down in the OS sources and wanted to leave it in the
archives for the next poor sucker:

The docs indicate that a window created with WinCreateOffscreenWindow
will not have its own color table, but will instead use the screen
color table. There are two bugs here (in both the 3.5 and 4.0
sources).

One, if you call WinRGBToIndex and the draw window has no color table,
it will get a color table from the hardware (this is in
BltFindIndexes). However, it creates the color table at the maximum
bit depth supported by the hardware, which is not necessarily the
current bit depth. So it is possible to get back a color table entry
which is out of range, which results in an "Index out of range" error
in SetForeColor under a debug ROM.

Two, if you call WinIndexToRGB, there is no support for getting a
color table from the screen as described in the docs; it calls
WinPalette which shows a "Draw window has no palette" under a debug
ROM.

Jake

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

Reply via email to