开发者

Draw shape to alpha channel only

开发者 https://www.devze.com 2023-01-06 13:53 出处:网络
I want to draw a shape to the alpha channel only of my image.I can use a colour matrix when drawing an 开发者_StackOverflow社区image with Graphics.DrawImage(..), as it has a parameter to pass in the I

I want to draw a shape to the alpha channel only of my image. I can use a colour matrix when drawing an 开发者_StackOverflow社区image with Graphics.DrawImage(..), as it has a parameter to pass in the ImageAttributes. Is it possible to do this with the FillEllipse method? Or would I have to draw it to a separate image, then use DrawImage to apply it to my main image?

Cheers, Dan.


You may try something like:

Graphics g;
g.CompositionMode = CompositingMode.SourceOver;

then fill with:

Color c = Color.FromArgb(100, Color.White);
0

精彩评论

暂无评论...
验证码 换一张
取 消