Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

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!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900