本文介绍了更改图片盒中图像的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的朋友,
我想更改图片框中图像的颜色.有两个按钮,一个用于绿色,另一个用于红色,因此,当用户单击绿色时,图片框图像将填充透明的绿色(现有图像也将可见,但是图像上将填充一层绿色),对于红色.
请帮助我,,
在此先感谢
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
推荐答案
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!
这篇关于更改图片盒中图像的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!