Last active
December 19, 2015 08:07
-
-
Save mag5323/92620839460c24faf203 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Bitmap bmp1 = new Bitmap(AppDomain.CurrentDomain.BaseDirectory + "STU.bmp"); | |
Bitmap bmp2 = new Bitmap(256, 256); | |
Color myColor = new Color(); | |
int T = 75; | |
for (int r = 0; r < bmp1.Height; r++) { | |
for (int c = 0; c < bmp1.Width; c++) { | |
myColor = bmp1.GetPixel(c, r); | |
if (myColor.G > T) { | |
bmp2.SetPixel(c, r, Color.FromArgb(255, 255, 255)); | |
} | |
else { | |
bmp2.SetPixel(c, r, Color.FromArgb(0, 0, 0)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment