Because I got offline questions, here is the final summary.

First the problem statement:
1. The bitmap returned from BmpCreate() may not be a chunk, i.e. it can be a
pointer to the middle of the chunk.
2. On the ARM machine due to alignment issues the bitmap header has
different length. Therefore the procedure with BmpSize() simply does not
work. That was what I observed as bitmap offset, resp. swapping right and
left half of the bitmap.

Our solution:
Take Palm BitmapRsrc.c sample - requires Palm SDK 5.0. It can be downloaded
somewhere from the Palm page.
Instead of BmpCreate() use BmpRsrcCreate(). (The result is a single
allocated chunk - possibly exceeding 64K - that can be casted to BitmapPtr.)
Instead of BmpDelete() use BmpRsrcDelete(), but the same job will do also
MemPtrFree().
To get the total bitmap size use MemPtrSize(). You can alloc the block of
this size (e.g. on the storage heap), copy bitmap there and then use it from
the new block.

Jan Slodicka



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

Reply via email to