IIMage to IBitmap please help | developer.brewmp.com IIMage to IBitmap please help | developer.brewmp.com

Developer

IIMage to IBitmap please help

Forums:

Anyone who knows why this doesnt result in any data in pixelbuffer(bitmap) please help?

int GetBuffer(xxxxHandle handle, void** buffer)
{
xxxx_image_t *imagePtr;
TMsfAppData *pApp = MSF_GET_APP;
IBitmap *pDeviceBitmap; /* Device bitmap */
IBitmap *pCastedBitmap;
AEEBitmapInfo bitmapInfo;
IDIB xIDIB;
IDIB *pIDIB;
int retVal;

imagePtr = (xxxx_image_t*)handle;

if (imagePtr != NULL)
{
if (imagePtr->m_pIImage != NULL)
{
/* This is quite a work around to get the decoded image and send to xxxx */

/* Pick up bitmap */

retVal = IDISPLAY_GetDeviceBitmap(pApp->m_AEEApplet.m_pIDisplay, &pDeviceBitmap);

if (retVal == SUCCESS)
{
/* Get width and height */
retVal = IBITMAP_GetInfo(pDeviceBitmap, &bitmapInfo, sizeof(AEEBitmapInfo));

if (retVal == SUCCESS)
{
/* Create device independent */
pIDIB = &xIDIB;
retVal = IDISPLAY_CreateDIBitmap(pApp->m_AEEApplet.m_pIDisplay,
&pIDIB,
(uint8) bitmapInfo.nDepth,
124,//hard coded data for test(uint16) bitmapInfo.cx,
169);//hard coded data for test//(uint16) bitmapInfo.cy);

if (retVal == SUCCESS)
{
/* Cast IDIB */
pCastedBitmap = IDIB_TO_IBITMAP(pIDIB);

if (pCastedBitmap != NULL)
{
/* Decide where to put display image */
retVal = IDISPLAY_SetDestination(pApp->m_AEEApplet.m_pIDisplay,pCastedBitmap);

if (retVal == SUCCESS)
{
/* Write into dedicated buffer */
IIMAge_Draw(imagePtr->m_pIImage,0,0);
//IIMAGE_DrawOffscreen(imagePtr->m_pIImage,1);

/* Get the bitmap member */
*buffer = pIDIB->pBmp;
return 1;

}

BR.
Roger

-----------------------
Adding [code] tags for readability
-Max

The BREW's DIB class does not implement IBITMAP_BltIn(), which is required by IIMAGE_Draw().

The BREW's DIB class does not implement IBITMAP_BltIn(), which is required by IIMAGE_Draw().

Is there another way to acheive this?

Is there another way to acheive this?

You may want to try with a compatible device dependent bitmap and try calling IIMage_Draw on that.

You may want to try with a compatible device dependent bitmap and try calling IIMage_Draw on that.