> > A "BitmapType *" is an opaque type on Palm OS, and you cannot assume it > points to a memory manager chunk of heap memory. Fortunately, there are > routines to do what you want. > > Rather than use MemPtrSize, use BmpSize. The bitmap might be an indirect > bitmap, so you'd have to also use BmpGetSizes to get the size of both the > header and the bitmap data. >
Thank you. BmpSize() really works the way as you wrote, but it is probably no solution either. Actually my problem is following: I want to keep the bitmaps in a cache allocated in the storage heap and (for reading purposes) to access them directly without the need to reconstruct them. For that purpose I made a general cache able to store memory blocks. I thought that knowing bitmap size would be all what is needed: A DB record of given size would be allocated and bitmap copied there. This way the things really worked on the emulator (they still do) and until yesterday also on the handheld. After changing the bitmap size detection from MemPtrSize() to BmpSize() the HH does not freeze anymore, but the bitmap drawing starts somewhere in the middle of the line. (As if right and left side were swapped.) That means there is more to be considered. I can only speculate about the reasons, but you may know it... Here is the procedure that really works: - store in the cache only bitmap bits and for any read access do: -- allocate new bitmap -- copy bitmap bits -- display the bitmap -- delete the bitmap It works, but it is awfully slow. I guess I have to abandon the idea of having general-purpose cache and use special icon cache. Such a cache would allocate each block as a bitmap that could be then accessed directly from outside. A bit slower than my original implementation, but not that much. Could you tell me if there is a better way, please? Jan Slodicka -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
