How to create a mask bitmap by program?

Login to reply to this topic.
Thu, 2007-11-15 07:42
Joined: 2007-09-25
Forum posts: 1

Hi there,

I tried to create a mask bitmap by program but it failed.

My code looks like:

CFbsBitmap* mainBitmap = ... // load from a file
CFbsBitmap* maskBitmap = new CFbsBitmap();
maskBitmap->Create(MainBitmap Size, EGray256);
TBitMapUtil util(maskBitmap);
util.begin(0, 0);
for (int y = 0; y < height; y++) {
util.SetPos(0, y);
for (int x = 0; x < width; x++) {
util.SetPixel(0x80);
util.IncXPos();
}
}
util.End();

Finally I use the following code to draw the bitmap:

gc.DrawBitmapMasked(size_dest, mainBitmap, size_source, maskBitmap, EFalse);

But the image become black in the screen, is there any wrong with my code?

Does DrawBitmapMasked support varying transparency?

Thanks very much!


Wed, 2007-12-19 10:36
Joined: 2004-11-29
Forum posts: 1142
Re: How to create a mask bitmap by program?

It does, if you run a symbian os of a late model.

I don't remember exactly when it started supporting it, but I think it was somewhere towards the end of in 2nd edition... (FP2, FP3 or something)
And for UIQ, that would mean not in UIQ2, but supported in UIQ3

  • Login to reply to this topic.