Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I am trying to copy past part of the bit map using

IBITMAP_CreateCompatibleBitmap()

but not getting any clipped sub image on the screen can any one help????

 

IDISPLAY_GetDeviceBitmap(pMe->a.m_pIDisplay, &pIBitmap);
	IBITMAP_QueryInterface(pIBitmap, AEECLSID_DIB, (void **)&pBitmapIDIB);
	IBITMAP_GetInfo(pIBitmap,&bitmapInfo,sizeof(AEEBitmapInfo));
	
	IDISPLAY_CreateDIBitmap (pMe->a.m_pIDisplay,&pScreenIDIB,(uint8)bmpfile.bits_per_pixel,(uint16)(pMe->cxScreen),(uint16)(pMe->cyScreen));
	IBITMAP_CreateCompatibleBitmap(pIBitmap,&pNewBitmap,50,50);//(uint16)(pMe->cxScreen),(uint16)(pMe->cyScreen));

// Clone the image
	MEMCPY( (void*)((void*)pScreenIDIB->pBmp), (void*)((void*)pBitmapIDIB->pBmp), (uint16)(pMe->cxScreen*pMe->cyScreen));
	pScreenIDIB->cx = pBitmapIDIB->cx;
	pScreenIDIB->cy = pBitmapIDIB->cy;
	pScreenIDIB->nDepth = pBitmapIDIB->nDepth;
	pScreenIDIB->nColorScheme = pBitmapIDIB->nColorScheme;
	
	
	IBITMAP_BltIn(IDIB_TO_IBITMAP(pScreenIDIB), 100,100, 50,50,IDIB_TO_IBITMAP(pScreenIDIB), 0,0, AEE_RO_COPY);
	
	IDISPLAY_Update(pMe->a.m_pIDisplay);

Thanks

Raj

Following code snippet should be enough to copy the part of bitmap into another new bitmap:
IDISPLAY_GetDeviceBitmap(pMe->piDisplay, &pDevBitmap);
IBITMAP_CreateCompatibleBitmap(pDevBitmap,&pMe->pIBitmap, 100, 100);
IBITMAP_BltIn(pMe->pIBitmap, 0, 0, 100, 100, pDevBitmap, 100, 100, AEE_RO_COPY);
IDISPLAY_Update(pMe->piDisplay);

I tried displaying newly created bitmap using below code to see if copy operation succeeded. IDISPLAY_ClearScreen(pMe->piDisplay);
IDisplay_BitBlt(pMe->piDisplay, 0, 0, 100, 100, (void*)pMe->pIBitmap, 0, 0, AEE_RO_COPY);
IDISPLAY_Update(pMe->piDisplay);

Following code snippet should be enough to copy the part of bitmap into another new bitmap:
IDISPLAY_GetDeviceBitmap(pMe->piDisplay, &pDevBitmap);
IBITMAP_CreateCompatibleBitmap(pDevBitmap,&pMe->pIBitmap, 100, 100);
IBITMAP_BltIn(pMe->pIBitmap, 0, 0, 100, 100, pDevBitmap, 100, 100, AEE_RO_COPY);
IDISPLAY_Update(pMe->piDisplay);

I tried displaying newly created bitmap using below code to see if copy operation succeeded. IDISPLAY_ClearScreen(pMe->piDisplay);
IDisplay_BitBlt(pMe->piDisplay, 0, 0, 100, 100, (void*)pMe->pIBitmap, 0, 0, AEE_RO_COPY);
IDISPLAY_Update(pMe->piDisplay);

Thanks adhudase,:)

Thanks adhudase,:)

hi adhudase is it possible to use dat pasted part image so that i can move dat pasted image anywhere on screen?
Thanks
Raj

hi adhudase is it possible to use dat pasted part image so that i can move dat pasted image anywhere on screen?
Thanks
Raj

You can use bitmap pointer pMe->pIBitmap to do any operations on that.

You can use bitmap pointer pMe->pIBitmap to do any operations on that.