Hi,
I found the following formula from the emf reference manual. This
formula deals with tow bitmaps for alpha-blending. Could anyone let
me know how do I apply the following equation in a single bitmap which
has the black color in place of the transparent areas.
src.Red = src.Red * (SrcConstantAlpha/255.0)
src.Green = src.Green * (SrcConstantAlpha/255.0)
src.Blue = src.Blue * (SrcConstantAlpha/255.0)
dst.Red = src.Red + (1.0 - (src.Alpha/255.0)) * dst.Red
dst.Green = src.Green + (1.0 - (src.Alpha/255.0)) * dst.Green
dst.Blue = src.Blue + (1.0 - (src.Alpha/255.0)) * dst.Blue
If the destination bitmap has an alpha channel, then it is blended as
follows:
src.Alpha = src.Alpha * (SrcConstantAlpha)/255.0)
dst.Alpha = src.Alpha + (1.0 - (src.Alpha/255.0)) * dst.Alpha
Note that if SrcConstantAlpha is 0xFF, there is in effect no
premultiplication of the source values.
Thanks in advance,
Karthik