Hi,
I found something unexpected while trying to draw white text on a
textured background in 256 color mode with a custom palette. I was using the
method mentioned in post 52788 of this newsgroup, which uses the following
set of calls:
WinSetTextColor(0);
WinSetBackColor(255);
WinSetDrawMode(winErase);
WinPaintChars(txt, StrLen(txt), x, y);
With a standard palette this works fine. But with a custom palette, I get
weird results. What I first did was to use:
WinSetTextColor(GetWhiteColorIndex());
WinSetBackColor(GetBlackColorIndex());
where GetxxxColorIndex() are routines I wrote to pick out the white & black
colors in my custom palette (and they work correctly: I've verified this). I
was going by the documentation on page 150 of the Palm OS Programmer's
Companion, Volume 1 (for OS 4.0), which specifies white and black pixels
instead of 0 and 1. Unfortunately, this gave me modulated text (i.e., the
text looked like birds had been pecking on it).
I tried substituting 0 and 255 as in the original example, and this gave
me sharply defined text, but in the wrong color (it was black, not white). I
then tried using a similar method for drawing black text on a textured
background:
WinSetTextColor(255);
WinSetBackColor(0);
WinSetDrawMode(winOverlay);
WinPaintChars(txt, StrLen(txt), x, y);
Again, I got sharp text, but in purple instead of black.
It seems that the special drawing modes rely on 0,255 values (instead of
"white pixel" and "black pixel" values as mentioned in the documentation).
Does this mean that I absolutely have to have 0 for the white index and 255
for the black index, even in my custom palettes, for this to work? Or am I
missing something? It's not a big deal for me, but it'll be a headache for
our artist if he has to change all of those palettes... :)
Thanks in advance for any help!!!
-----> kell
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/