I need to write skined program. Some gui parts of it should be transparent, not based on some constant value, but special image.

For example
This is mask:

And this is image:

I need to get this result:

I have:

typedef struct tagAlphaImage { BYTE R,G,B, Alpha } AlphaImage;
HBITMAP hImage, hMask;
int Width,Height; //Mask and Image have same Width and Height.

What im doing is this:

//geting screen dc

//Create Alpha image
AlphaImage *myAlphaImage;
myAlphaImage = CreateAlpha(hImage,hMask);

And then im going to get bitmap based on data from hDeskHDC.

Merge it with myAlphaImage.

And draw result.

Is it right way, or there is much better and faster way ?
The problem is that im doing all the merging myself.
Is there some API functions to do that ?
Posted on 2002-06-12 16:12:04 by pahan
Win2k and XP might have such functions in GDI32+ but on Win98 you must do it by hand :(
Posted on 2002-06-12 16:17:24 by BogdanOntanu