In a message dated 6/13/00 4:35:58 AM Eastern Daylight Time,
[EMAIL PROTECTED] writes:
<< Hi,
Prior to OS3.5, the rowBytes in the BitmapType were calculated as bitmap
width/8 or part thereof. (ie. If the bitmap was 75 pixels wide, rowBytes =
10).
Can someone tell me how the rowBytes are calculated for a palm running the
OS3.5? I seem to get 76 for a 75 pixel wide bitmap.
Thanks,
Trung >>
Each bitmap row is probably aligned to a 32-bit boundary (don't know for sure
as I've never looked into it, but its not unreasonable). Your results are
consistent with bitmap depths at various bits-per-pixel (in your case, 1bpp
when < OS3.5 and 8bpp when OS3.5).
The calculation for rowsize that you should be using is something like
//Calculate DWORD-aligned bytecount based on a bitcount.
#define WIDTHBYTES(bits) (((bits) + 31L) / 32L * 4)
//Calculate DWORD-aligned bytecount based on pixel count and bitcount per
pixel.
#define ROWBYTES(cx, bpp) WIDTHBYTES(cx * bpp)
Hope this helps, -Pete
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/