bitmap - Strengthen RGB colors using c# -
i need strengthen rgb channel/colors number user can choose. i've got following code , i'm not sure it's correct. can tell me can change or can better.
int value = int.parse(textboxconstante.text); (int y = 0; y < mypic.height; y++) { (int x = 0; x < mypic.width; x++) { color c = mypic.getpixel(x, y); mypic.setpixel(x, y, color.fromargb(c.r * value /10, c.g * value/10, c.b * value/10)); } }
i've not run code, suspect you're having problems c# lack of implicit double casting... try rewriting way:
.fromargb((int)(c.r * ((double)value /10)), [the rest wrapped same way]
Comments
Post a Comment