I'm having a really strange problem. I create a 160x20 bitmap using
BmpCreate and I just want to fill the pixels with 16 bit values starting at 1
and working my way up. For some reason when I get to a certain point (2048
pixels) it seems to reset and start over with the pixel values. I realize
that this is a poor explination, but look at it in POSE... ;} It's the 13th
line, 32 pixels from the end. Any help that anyone can give would be greatly
appreciated. I can't figure out why this happens...why would it work right
up until the 2048th pixel...any why would it act like it starts over again?
Is the bitmap data area not a bunch of pixel values stacked together?
Here is the code that I'm using...nothing to fancy:
void ProcessImage() {
int pixelNum;
UInt16 pixelValue = 0;
UInt16 err;
UInt16 imageArray[160], bitsSize;
BitmapType * newBitmapP;
UInt8 * theBitsP, * theEndP, * theLineP;
void * fooP;
newBitmapP = BmpCreate( 160, 20, 16, NULL, &err );
bitsSize = BmpBitsSize( newBitmapP );
theBitsP = BmpGetBits( newBitmapP );
theEndP = theBitsP + bitsSize;
fooP = imageArray;
while ( theBitsP < theEndP ) {
testP = fooP;
for( pixelNum = 0; pixelNum < 160; pixelNum++ ) {
imageArray[pixelNum] = pixelValue++;
}
theLineP = theBitsP + 320;
while( theBitsP < theLineP ) {
*theBitsP++ = *testP++;
}
}
WinDrawBitmap( newBitmapP, 0, 0 );
}
}
Thanks in advance,
-Robert
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/