OK, now I see you're using
. For performance reasons, never use
. The MSDN help page has a code sample:
There are different approaches to color balance. You can implement the simplest approach: a manual balance. You present reg, green and blue sliders; the user adds or reduces the contribution of each; and you retouch each color component one by one for each pixel.