Draw shape to alpha channel only

大城市里の小女人 提交于 2019-12-24 09:57:30

问题


I want to draw a shape to the alpha channel only of my image. I can use a colour matrix when drawing an 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.


回答1:


You may try something like:

Graphics g;
g.CompositionMode = CompositingMode.SourceOver;

then fill with:

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


来源:https://stackoverflow.com/questions/3222411/draw-shape-to-alpha-channel-only

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!