1.

Why Do We Get Memory Errors Such As "memheap.c 0696" When Using Idisplay_bitblt() To Draw A Bitmap Image?

Answer»

Ensure that you are freeing the MEMORY allocated by CONVERTBMP. Check the LAST Boolean parameter of CONVERTBMP. If True, a REALLOCATION was done and the memory must be freed USING SYSFREE.

For example:

pBmp = CONVERTBMP (pDataBytes, &imageInfo, &bVal);
IDISPLAY_BitBlt (pIDisplay, xDest, yDest, cxDest,
cyDest, pBmp, xSrc, YSRC, dwRopCode);
IDISPLAY_Update (pIDisplay);
if(bVal) //free only if realloc was done
SYSFREE (pBmp);

Ensure that you are freeing the memory allocated by CONVERTBMP. Check the last Boolean parameter of CONVERTBMP. If True, a reallocation was done and the memory must be freed using SYSFREE.

For example:

pBmp = CONVERTBMP (pDataBytes, &imageInfo, &bVal);
IDISPLAY_BitBlt (pIDisplay, xDest, yDest, cxDest,
cyDest, pBmp, xSrc, ySrc, dwRopCode);
IDISPLAY_Update (pIDisplay);
if(bVal) //free only if realloc was done
SYSFREE (pBmp);



Discussion

No Comment Found