If the destination bitmap has an alpha channel, then the blend is as follows.
Dest.alpha = Src.Alpha + (1 - SrcAlpha) * Dst.Alpha
If the source has both theSourceConstantAlpha(that is, it is not 0xFF) and per-pixel alpha, the source is pre-multiplied by theSourceConstantAlphaand then the blend is based on the per-pixel alpha. The following equations show this. Note thatSourceConstantAlphais divided by 255 because it has a value that ranges from 0 to 255.
Src.Red = Src.Red * SourceConstantAlpha / 255.0; Src.Green = Src.Green * SourceConstantAlpha / 255.0; Src.Blue = Src.Blue * SourceConstantAlpha / 255.0; Src.Alpha = Src.Alpha * SourceConstantAlpha / 255.0; Dst.Red = Src.Red + (1 - Src.Alpha) * Dst.Red Dst.Green = Src.Green + (1 - Src.Alpha) * Dst.Green Dst.Blue = Src.Blue + (1 - Src.Alpha) * Dst.Blue Dst.Alpha = Src.Alpha + (1 - Src.Alpha) * Dst.Alpha
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-26788-3.html
您为光棍出了很好的主意
wuIi烊烊