The code you gave below for writing the bitmap makes several invalid
assumptions about the bitmap format.  Read up more about OS5 in general and
PACE in particular to understand why what you're doing won't work.  (PACE is
the 68k emulator layer responsible for running your 68k-based app on the
ARM-based OS5 device).

Read the "OS 5 High Density Overview and FAQ" in the PalmSource Knowledge
Base.  At least 5 of the topics in that contain information directly
relevant to your issue, even though your issue isn't specifically about high
density.  It even has sample code to help you work with bitmaps that can be
written to a database.  I've run across several other KB and FAQ articles on
this topic but I don't remember the links to them.  Look them up yourself.

Here's a brief summary to help you look in the right directions.  Your code
assumes that the bitmap structure is stored as a single contiguous chunk of
memory, and that you have access to the raw bitmap data.  Neither is
necessarily true in OS5 anymore.



> Code for writing the bitmap resource
> =========================
> BitmapType *wowScratchBitmapP, *resBitmapP;
> ...
> WinHandle saveWinH = WinSaveBits ( &bounds , &err );
> ....
> wowScratchBitmapP = WinGetBitmap ( saveWinH );
> ...
>  // open/create database to save
> ....
> // if resource already exist remove it using DmRemoveResource
> ...
>  resH = DmNewResource (dbScratchRef, bitmapRsc, resID, BmpSize
> (wowScratchBitmapP) );
> ...
>  resBitmapP = (BitmapType*) MemHandleLock (resH);
>  DmWrite ( resBitmapP, 0, wowScratchBitmapP, BmpSize
(wowScratchBitmapP) );
>  MemHandleUnlock (resH);
>  DmReleaseResource (resH);



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

Reply via email to