Here's the fucntions I use for drawing tiny text on a hi-res screen. Seems to work fine for me. I leave it as an exercise for the reader to add proper error checking and screen resolution detection (stripped for brevity)
Note:
linewin is an offscreen window which is font height tall and 320 pixels wide (in hires).


void
Main::DrawText (Coord x,
Coord y,
Char* str)
{
BitmapPtr bmp;
RectangleType r;
bmp = draw.GetWindowBitmap(lineWin);
WinSetDrawWindow(lineWin);
r.topLeft.x = 0;
r.topLeft.y = 0;
r.extent.x = 320;
r.extent.y = FntCharHeight();
WinEraseRectangle(&r, 0);
WinDrawChars(buffer, StrLen(buffer), 0, 0);
BmpSetDensity(bmp, kDensityDouble);
WinCopyRectangle(lineWin, WinGetDisplayWindow(), &r, x, y, winPaint); BmpSetDensity(bmp, kDensityLow);


   WinSetDrawWindow(WinGetDisplayWindow());
} // DrawText

Chris Olson


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

Reply via email to