With this code I can make a picture black and white. But how can I get the numbers from the picture into a label?
Bitmap BMP = new Bitmap("H:\\pelak.jpg");
Color col;
//int r, g, b, rgb;
byte blue, green, red;
for (int i = 0; i < Int32.Parse(BMP.Width.ToString()); i++)
{
for (int j = 0; j < Int32.Parse(BMP.Height.ToString()); j++)
{
col = BMP.GetPixel(i, j);
blue = col.B;
green = col.G;
red = col.R;
if (red < 128)
{
BMP.SetPixel(i, j, Color.FromArgb(0, 0, 0));
}
if (red >= 128)
{
BMP.SetPixel(i, j, Color.FromArgb(255, 255, 255));
}
}
}
pictureBox2.Image = BMP;