The symptom is no bitmap is drawn to the screen...  The size of the bitmap
is 160 wide by 369 high.

Any help you can lend is most appreciated.  For example, how to get an error
status from WinDrawBitmap() or, WinCopyRectangle()?

BitmapType *t = (BitmapType *)pBMPData;
// Collect dimensions:
Coord cheight,cwidth;
UInt16 rowBytes;
BmpGetDimensions(t,&cwidth,&cheight,&rowBytes);
    height = (unsigned short)cheight;
    // Create an offscreen window to accomodate the bitmap:
UInt16 error=1;
WinHandle wh =
WinCreateOffscreenWindow(cwidth,cheight,nativeFormat,&error);
if (errNone == error)
{
// Draw the bitmap on the screen at 0,0 of the offscreen
bitmap:
WinHandle screenH = WinSetDrawWindow(wh);
    WinDrawBitmap(t, 0, 0);
    WinSetDrawWindow(screenH);
// Clip the image:
RectangleType rt;
rt.topLeft.x = rt.topLeft.y = 0;
rt.extent.x = lowerRightX - upperLeftX;
if (cwidth < rt.extent.x)
rt.extent.x = cwidth;
rt.extent.y = lowerRightY - upperLeftY;
if (rt.extent.y > height)
rt.extent.y = (short)height;

WinCopyRectangle(wh,NULL,&rt,upperLeftX,upperLeftY,winPaint);
WinDeleteWindow(wh,false);
}

Paul Reger
Senior Software Engineer
Olive Tree Bible Software


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

Reply via email to