Thanks for the reply.
Tried it, just get the same black block I did with winErase mode. I had some marginal
luck not using WinPaintChars but using
WinEraseChars and WinInvertChars, but I wasn't able to set the text color and it
didn't work on grayscale devices.
Here's the failing code snippet:
RGBColorType rgb;
IndexedColorType idxColor;
rgb.r = GetRValue( 0 );
rgb.g = GetGValue( 0 );
rgb.b = GetBValue( 0 );
idxColor = WinRGBToIndex( &rgb );
WinSetTextColor( idxColor );
rgb.r = GetRValue( 255 );
rgb.g = GetGValue( 255 );
rgb.b = GetBValue( 255 );
idxColor = WinRGBToIndex( &rgb );
WinSetBackColor( idxColor );
WinSetDrawMode( winMask ); //or winErase
WinPaintChars("Whatever", 8, 0, 0 );
rgb.r = GetRValue( 0 );
rgb.g = GetGValue( 0 );
rgb.b = GetBValue( 255 );
idxColor = WinRGBToIndex( &rgb );
WinSetTextColor( idxColor );
rgb.r = GetRValue( 0 );
rgb.g = GetGValue( 0 );
rgb.b = GetBValue( 0 );
idxColor = WinRGBToIndex( &rgb );
WinSetBackColor( idxColor );
WinSetDrawMode( winOverlay );
WinPaintChars("Whatever", 8, 0, 0 );
- John
> >It appeared from the documentation that the way to go would be to use
> >WinPaintChars with a masking methodology, paint the characters once with
> >WinSetDrawMode( winErase ), and then drawing them again with
> >WinSetDrawMode( winOverlay ), with appropriate background and foreground
> >colors set. That, of course didn't work.
>
> You're on the right track, that's exactly how you should be doing
> it. However,
> there is a bug in the Visor Edge OS, and in any Handspring device using the
> 3.5.2 v1.4 update which causes the winErase blitter mode to fail. Use winMask
> instead, and it should work:
>
> WinSetTextColor( (1<<depth)-1 ); // 255 for 8 bit mode, 15 for 4 bit mode, etc
> WinSetBackColor( 0 );
> WinSetDrawMode( winMask );
> WinPaintChars( txt, len, x, y );
>
> WinSetTextColor( indexOfDesiredTextColor );
> WinSetBackColor( 0 );
> WinSetDrawMode( winOverlay );
> WinPaintChars( txt, len, 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/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/