David,

Thanks for the reply.

I found the examples you mentioned.  I even figured out a way (I think) to
copy the header and data bits independently for OS 3.5/4 (see below).  Yet,
this still does not work in OS 5.

My problem with the BitmapRsrc code is that it starts by building a BMP
resource bit by bit.  It calls its version of BmpCreate and fills it by
setting each pixel's RGB value.  I am wanting to grab a region from the
screen and save it.  Hopefully I don't have to do it a pixel at a time.
When I try to create a new BMP and populate it myself, I seem to get all
different sizes resulting from various WinCreate, BmpCreate, etc.  I realize
the simulator adjusts between low density and high density for
compatibility.  Yet, I cannot seem to get it to use just high density mode
and work like the pre OS 5 code does.

Do you feel there is a way to get a screen region, store its BMP header and
data bits, then restore it, all without resorting to a pixel level copy?
Any ideas on how to make something like this work?

Thanks again for the assistance!
Dave

    winHandle = WinCreateOffscreenWindow(drawData.r.extent.x,
drawData.r.extent.y, screenFormat, &err );
    WinCopyRectangle(NULL, winHandle, &drawData.r, 0, 0, winPaint);
    pLocalBitmap = WinGetBitmap(winHandle);
    BmpGetSizes(pLocalBitmap, &dataSizeP, &headerSizeP);
    nSize = dataSizeP + headerSizeP;
    pData = MemPtrNew(nSize);
    MemSet(pData, nSize, 0);
    MemMove(pData, pLocalBitmap, headerSizeP);
    MemMove(pData + headerSizeP, BmpGetBits(pLocalBitmap), dataSizeP);
    WinDrawBitmap((BitmapPtr)pData, drawData.r.topLeft.x,
drawData.r.topLeft.y);  << Redraw to verify
    WinDeleteWindow(winHandle, false);


Is this bad code for OS 3.5/4.0?  BTW. The screen region BMP will only be
restored to the same device.  Also, the stored BMP images do not have to
work between OS versions.



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

Reply via email to