BmpBitsSize returns the correct value But after I do a memcpy, it overwrites the value:
ptr = (unsigned char *) BmpGetBits(bmp); size = BmpBitsSize(bmp); memcpy(ptr,myarray,size); "DeAnna Davidson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > <caveat> I've not actually used it before so I may not be right. </caveat> > According to the docs, the bitmap created with BmpCreate contains no data. > I'm not sure if that means it doesn't allocate any memory for the data or > just that there is nothing there. The easiest way to find out is to use > BmpBitsSize and see if it actually returns the number you think it should. > Logically, if it returns zero, then no, it doesn't allocate the memory. > Either way, you should still probably be using BmpBitsSize to get the limits > for the buffer so you know when to stop modifying things. > > DeAnna > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Behalf Of > > [EMAIL PROTECTED] > > Sent: Wednesday, November 15, 2000 12:25 PM > > To: Palm Developer Forum > > Subject: BmpCreate and memory corruption > > > > > > Thanks for everyone's help on the previous related post - I am able to > > display runtime bitmaps now. > > > > I have another question. > > > > Does BmpCreate allocate the memory needed for the bitmap data? > > > > > > i.e., when I do a > > > > bmp = BmpCreate(10,10,8,NULL,error); > > > > does it allocate 100 bytes at the end of the header for the > > bitmap data? > > or do I have to manually allocate the memory? > > > > I'm finding that if I use BmpGetBits to retrieve the bitmap > > data pointer > > and then modify the contents, I corrupt some of the local > > variables in the > > same function. > > > > > > > > > > > > > > -- > > For information on using the Palm Developer Forums, or to > > unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ > > > > > -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
