At 11:14 AM 5/3/01 -0700, you wrote:
>I'm facing a situation on a Visor Prism where I have to draw characters in 
>a user-specified color on an unknown color background. In fact, for all I 
>know I'll be drawing chars across a multi-colored background or an image. 
>I am NOT supposed to paint the entire rectanglar bitmap containing the 
>char; only the bits that comprise the actual char itself.
>
>If I am drawing black chars, winOverlay mode and WinPaintChars() works fine.
>
>But if I am drawing white chars on a black background, I get into big trouble.
>
>Is there a single WinDrawMode that, combined with WinPaintChars(), will do 
>what I need? I wrote a little test program to paint black chars on a white 
>background and vice versa in every possible WinDrawMode, and I can't find 
>one that works in both cases unless I screwed something up.
>
>If not, can anyone think of a workaround that would help, given my 
>constraints?

You can't do it with a single call to WinPaintChars(), you need to do two 
calls:

For 256 color (8-bit depth) mode:

// erase the pixels of the text

WinSetTextColor( 0 );
WinSetBackColor( 255 );
WinSetDrawMode( winErase );
WinPaintChars( txt, x, y );

// logical OR the black pixels with the color you want them to be

WinSetTextColor( indexOfColorYouWantTheTextToBe );
WinSetBackColor( 0 );
WinSetDrawMode( winOverlay );
WinPaintChars( txt, x, y );


--
Bill Kirby
Electron Hut
www.electronhut.com





-- 
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