how to mask image?

Login to reply to this topic.
Tue, 2006-03-14 10:11
Joined: 2006-03-11
Forum posts: 43
can anybody pls tell me how to mask one bmpimage in symbian c++?

Tue, 2006-03-14 11:05
Joined: 2004-11-29
Forum posts: 1246
Re: how to mask image?
Use the DrawBitmapMasked if you need scale, or BitBltMasked if you dont, and set the brush to ENullBrush.
Sat, 2006-03-25 09:39
Joined: 2006-03-11
Forum posts: 43
Re: how to mask image?
the syntax of bitbltmask is:
virtual void BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);

The first is the image it self, and the second is monocrome mask image..
aMaskBitmap is the masked image no?
so how can i mask the image?
Mon, 2006-03-27 12:23
Joined: 2005-08-04
Forum posts: 128
Re: how to mask image?
hi,

just fill black color in the area which is covered by the image.
Tue, 2006-03-28 06:22
Joined: 2006-01-09
Forum posts: 105
Re: how to mask image?
Hi,

as sunny says...just above me...

if u want to make the mask then follow this simple step....

if u hv circle in ur actual image..
then in ur mask image this circle must be black having same area as actual....


Best Regards
CodePupil

Thanks and Regards
CodePupil
__________________________
You are I and I am he .. !!

Thu, 2006-12-21 08:55
Joined: 2006-03-01
Forum posts: 11
Re: how to mask image?
Hi,

Can u tell me how you masked a bitmap image. did u use the bmconv tool to convert a masked image to a mbm file and used the bitbltmasked() to render the image and the mask.

was the mask a monochrome type image. please tell me how u did it. I actually want to display a transperant png, image.

Please give me any pointers.
Thu, 2006-12-21 10:03
Joined: 2004-11-29
Forum posts: 1246
Re: how to mask image?
There is two options for masks.

Either you use an EGray2 (monochrome) mask, and the mask will then either skip or use the pixel from the image depending on the mask color.
That is, either fully transparent, or fully opaque

Or you use an EGray256 (grayscale) mask, and then the image will be alpha-blended useing this mask as alpha channel. That is, pixels can also be semi-transparent.

You can either split your png into a mask bitmap and a color channel bitmap with some pc tool of your choise, and then make an MBM containing these two bitmaps,
or you can use CImageDecoder to load the PNG on the device.

Edit: Seeing your other post...  To get CImageDecoder to output a mask bitmap too, create it with EAllowGeneratedMask, and give it a mask bitmap to output too also, in your call to convert.
Thu, 2008-06-19 08:40
Joined: 2007-07-31
Forum posts: 159
Re: how to mask image?

I request u to paste the complete code to display the masked png image...

Thanks in advance...

Brajesh...


Life is too short ! so do as many good things as you can do...
Brajesh Kumar...
Beginner in Symbian C++

Tue, 2008-07-01 05:48
Joined: 2007-01-17
Forum posts: 99
Re: how to mask image?

It is better to use bitmaps for Images instead of PNGs and Use BitBltMasked() to draw using the image and its mask


Shashi Kiran G M

Tue, 2008-07-01 09:30
Joined: 2004-11-29
Forum posts: 1246
Re: how to mask image?

gmsk19:
why? That will take up more file space without any gain. (well, except not having to use CImageDecoder)

png files are compressed, and there are decoders available to decode them to two cfbsbitmaps, one for the color channels, and one for the mask/alphachannel.

Mon, 2008-08-11 11:42
Joined: 2007-01-17
Forum posts: 99
Re: how to mask image?

For Applications that are not bulky you can go with bitmaps instead fo pngs and you can further reduce the size of masks by going for monochrome bitmaps


Shashi Kiran G M

  • Login to reply to this topic.