Hi,
I copy a part from a bitmap to another new created bitmap. But when I try to draw it to the screen the part is drawn bigger then it must be. I'm trying for morethan 3 days please help. Here's my dealing part of the code :
void CTestContainer::CropBmpL()
{
bmp = new(ELeave) CFbsBitmap();
TSize size = iBmp->SizeInPixels();
bmp->Create(TSize(size.iWidth, size.iHeight/3),iBmp->DisplayMode());
bmp->LockHeap;
iBmp->LockHeap;
TUint16* bmpData = (TUint16*)bmp->DataAddress();
TUint16* iBmpData = (TUint16*)iBmp->DataAddress();
for(int i = 0; i < size.iHeight/3; i++)
{
for(int j = 0; j < size.iWidth; j++)
{
*bmpData = *iBmpData;
bmpData++;
iBmpData++;
}
}
bmp->UnlockHeap();
iBmp->UnlockHeap();
delete iBmp;
iBmp = bmp;
}
and the Draw function is :
void CTestContainer:raw(const TRect& /*aRect*/) const
{
CWindowGc& gc = SystemGc();
if(iCropped) // with the above function, CropBmpL
{
gc.SetPenColor(KRgbWhite);
gc.SetBrushColor(KRgbWhite);
gc.Clear();
gc.BitBlt(TPoint(0,0),iBmp); }
}
I tried TBitmapUtil, and DrawBitmap variations, also but I couldnot do it.
Please help...

raw(const TRect& /*aRect*/) const


