Wednesday, October 01, 2008

How to Copy BitMap Object to BitMap Object

We can load a bit map using CEikonEnv::CreateBitmapL()
CFbsBitmap* myBitmap = iEikonEnv->CreateBitmapL(KBmpPath,index);

Code below shows how to copy BitMap
CFbsBitmap* aBitmap = new (ELeave)CFbsBitmap;
aBitmap->Create(myBitmap->SizeInPixels(),myBitmap->DisplayMode());
TRect tempRect(TPoint(0,0),myBitmap->SizeInPixels() );
TInt iBufLength = tempRect.Width() * tempRect.Height() * 2;
Mem::Copy(aBitmap->DataAddress(),myBitmap->DataAddress(),iBufLength);

No comments:

stats counter