>Can anyone shed some light on why the following code snippet works fine on
>OS 3.5/4 and crashes on OS 5? What I am trying to do is copy an on-screen
>bitmap region to memory so that I can store it and re-blit it later.

The problem is that you're assuming that all the data of a bitmap is
contiguous in memory. That isn't necessarily the case: the header of a
bitmap can sometimes be a different memory chunk from the bits that make it
up.  The header sometimes contains a pointer to the bits, and sometimes it
follows it directly in memory.

There is a bunch of code in the seeding area of the Pavilion on palmos.com
which is designed to demonstrate the right way to do things like this.
It'll eventually be made public but it isn't quite as polished as they
want, I believe.  Check it out - it is called BmpRsc I think.

-David Fedor
PalmSource, Inc.

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

Reply via email to