I have a type “Bitmap” containing some random bitmap data. I wrote my own settings for brightness, color, saturation and hue, which act on each bit individually and, not surprisingly, it is terribly slow.
In my research, I noticed that using matrices can be very quick in adjusting them. In addition, .NET has ColorMatrix, where you can apply matrix effects when drawing DrawImage ().
The matrix we created is as follows (from the MSDN website):
float[][] colorMatrixElements = {
new float[] {2, 0, 0, 0, 0},
new float[] {0, 1, 0, 0, 0},
new float[] {0, 0, 1, 0, 0},
new float[] {0, 0, 0, 1, 0},
new float[] {.2f, .2f, .2f, 0, 1}};
But I could not find the correct ranges or what any of these numbers actually does. I don’t know how to adjust brightness, color, saturation and hue.
Any help ?? Am I missing some good documentation somewhere?
Thank!!