c++gdi如何让图片透明
1个回答
2018-06-23 · 知道合伙人互联网行家
关注
展开全部
GDI+中这个重载函数可以实现
Graphics.DrawImage ( _
image As Image, _
destRect As Rectangle, _
srcX As Integer, _
srcY As Integer, _
srcWidth As Integer, _
srcHeight As Integer, _
srcUnit As GraphicsUnit, _
imageAttr As ImageAttributes _
)
ImageAttributes有个成员方法.SetColorKey (Color, Color) ,可以设置透明色范围.如果你要做渐变透明也可以修改其他属性.比如使用颜色替换,背景色替换成半透明色
Graphics.DrawImage ( _
image As Image, _
destRect As Rectangle, _
srcX As Integer, _
srcY As Integer, _
srcWidth As Integer, _
srcHeight As Integer, _
srcUnit As GraphicsUnit, _
imageAttr As ImageAttributes _
)
ImageAttributes有个成员方法.SetColorKey (Color, Color) ,可以设置透明色范围.如果你要做渐变透明也可以修改其他属性.比如使用颜色替换,背景色替换成半透明色
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询