some query regarding bitmaps!!!!!!!!!
Login to reply to this topic.
Sat, 2008-11-01 11:14
Joined: 2007-05-15
Forum posts: 138

Hi,
We display a bitmap on the screen of mobile device....

I need to know if we can find each row and column of bitmap.
The I think I would need to cut one row from one bitmap image and paste it in another bitmap image.
where all bitmaps belong to one complete large picture. that is they are small parts of a bigger picture.

One more thing, I would like to know is ------
I use a bitmap object to draw an image on screen.
There will be atlaest 20-30 such bitmaps.
Can I combine all of them into a single image that would have dimension around 30 times bigger than the whole of mobile
screen and save it in memory. When I want to show this image , i would clip onto a particular part of it
and show that part only on the screen.......

Are these things possible........
Can anyone give me some guidelines....
any specific classes to refer to..
any example codes...........

Regards!
Sandeep.


Mon, 2008-11-03 09:41
Joined: 2004-11-29
Forum posts: 1419

The answer is yes to all of the above.

You can do it all using only CFbsBitmap CFbsBitmapDevice and CFbsBitGc classes.

There is only one function you need too: CFbsBitGc::BitBlt(const TPoint &aPoint, const CFbsBitmap *aBitmap, const TRect &aSourceRect);

aBitmap is your "big bitmap", aSourceRect is the rectangle of the big image you want to copy, aPoint is where you want to draw it in the bitmap assigned to the CFbsBitGc..

something like this:

CFbsBitmapDevice* bmpdev = CFbsBitmapDevice::NewL(iDestinationBmp); 

CFbsBitGc *bmpgc;
bmpdev->CreateContect(bmpgc);

bmpgc->BitBlt(TPoint(0,0), iBigSourceBmp, TRect(aOffsetOfSubBitmap, aSizeOfSubBitmap));

delete bmpgc;
delete bmpdev;


copyright 2003-2009 NewLC SARL