-
-
Save kasramp/4ed34c9a5cd2cfc464443f48b9b52ad2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void brightnessDown(PictureBox picImp) { | |
int[] RGB = new int[3]; | |
for (int i = 0; i <= x.Width - 1; i++) { | |
for (int j = 0; j <= x.Height - 1; j++) { | |
z = x.GetPixel(i, j); | |
RGB[0] = (z.R) - 15; | |
RGB[1] = (z.G) - 15; | |
RGB[2] = (z.B) - 15; | |
if (RGB[0] < 0) { | |
RGB[0] = 0; | |
} | |
if (RGB[1] < 0) { | |
RGB[1] = 0; | |
} | |
if (RGB[2] < 0) { | |
RGB[2] = 0; | |
} | |
y.SetPixel(i, j, Color.FromArgb(RGB[0], RGB[1], RGB[2])); | |
} | |
} | |
Message.setMessage(PicSave.savechange(picImp, y), "Brightness Down"); | |
} | |
private void brightnessUp(PictureBox picImp) { | |
int[] RGB = new int[3]; | |
for (int i = 0; i <= x.Width - 1; i++) { | |
for (int j = 0; j <= x.Height - 1; j++) { | |
z = x.GetPixel(i, j); | |
RGB[0] = (z.R) + 15; | |
RGB[1] = (z.G) + 15; | |
RGB[2] = (z.B) + 15; | |
if (RGB[0] > 255) { | |
RGB[0] = 255; | |
} | |
if (RGB[1] > 255) { | |
RGB[1] = 255; | |
} | |
if (RGB[2] > 255) { | |
RGB[2] = 255; | |
} | |
y.SetPixel(i, j, Color.FromArgb(RGB[0], RGB[1], RGB[2])); | |
} | |
} | |
Message.setMessage(PicSave.savechange(picImp, y), "Brightness Up"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment