On Thu, Nov 09, 2000 at 09:34:42AM +0200, Sami K wrote:
> Hello,
> I have developed an Palm application that receives a bitmap
> image from the serial port which is sent from a PC. Then I display the image
> on the Palm handheld. I have assigned the fields in the BitmapType
> structure correctly. My problem is that when I display the image, it appears
> to be inverted in color i.e white is inverted to black and vice versa. Can
> anyone please figure out this problem.
>
> BitmapPtr bitmap;
>
> bitmap->width = 160;
> bitmap->height = 160;
> bitmap->rowBytes = 20;
> bitmap->pixelSize = 1;
> bitmap->nextDepthOffset = NULL;
> bitmap->flags.compressed = 0;
> bitmap->version = 1;
> bitmap->flags.hasColorTable = 0;
Simple. Black and white have the opposite values that you are using.
Run through the image with *x = ~*x to change the bits.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/