更改图片盒中图像的颜色 [英] Change color of Image in Picture Box

查看:102
本文介绍了更改图片盒中图像的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我想更改图片框中图像的颜色.有两个按钮,一个用于绿色,另一个用于红色,因此,当用户单击绿色时,图片框图像将填充透明的绿色(现有图像也将可见,但是图像上将填充一层绿色),对于红色.


请帮助我,,

在此先感谢

Dear friends,

I want to change the color of Image in Picture Box.For eg. There are two buttons one for Green and other for Red,so when user click on Green the Picture box image filled with transparent green color(Existing image will also be visible but a layer of green color will filled over image),same will happen for Red color.


Please help me,,,

Thanks in advance

推荐答案

尝试使用半透明笔刷绘制一个填充的矩形:
Try drawing a filled rectangle with a semi transparent brush:
SolidBrush semiTransparentBrush = new SolidBrush(Color.FromArgb(90, 255, 0, 0)); // 90 is the alpha value (range goes from 0 - completely transparent, 255 - solid)
image.FillRectangle(semiTransparentBrush, 0, 0, image.Width, image.Height);


祝你好运!


Good luck!


这篇关于更改图片盒中图像的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆