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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -