Create transparent bitmap, draw text to the bitmap, draw bitmap. Second step
is illustrated by the code below.
Jan Slodicka
static void DrawTextToBitmap( BmpRsrcType* result, const char* text, UInt16
len )
{
Err error;
WinHandle oldWinH = WinGetDrawWindow();
WinHandle winH = WinCreateBitmapWindow( (BitmapPtr)result, &error );
if( winH != NULL )
{
WinSetDrawWindow( winH );
WinSetForeColor( 1 ) ;
WinSetBackColor( 0 ) ;
WinDrawChars( text, len, 0, 0 );
WinSetDrawWindow( oldWinH );
WinDeleteWindow( winH, false );
BmpRsrcSetFlag( result, kHasTransparencyFlag, true );
}
}
----- Original Message -----
From: "Armada.li" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Saturday, November 22, 2003 8:04 PM
Subject: How do I keep up the background bitmap when I draw texts on it
> I use codewarrior9 and PilRC Designer,and develop for Palm(above
Palmos3.5).
> I draw a beautiful bitmap on the form as its background,and I want to draw
> texts on the bitmap now.
> I find WinDrawInvertedChars and WinDrawChars will destroy the background
> bitmap.Please see the attachment.
> How do I keep up the background bitmap?
> Please help me,and thanks.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/