private void button13_Click(object sender, EventArgs e) { Bitmap resim = new Bitmap(pictureBox2.Image); Color renk, renk2; int r, g, b, d; for (int i = 0; i < resim.Width; i++) { for (int j = 0; j < resim.Height; j++) { renk = resim.GetPixel(i, j); r = renk.R; g = renk.G; b = renk.B; d = (r + g + b) / 3; if (d < 55) { d = renk.R; } if (d > 55 && d < 155) { d = renk.G; } if (d > 155 && d < 255) { d = renk.B; } resim.SetPixel(i, j, renk); renk2 = Color.FromArgb(d, d, d); } pictureBox3.Image = resim; }
bmp = New BitmapImage(New Uri(dlg.FileName)) Dim GreyBmp As New FormatConvertedBitmap GreyBmp.BeginInit() GreyBmp.Source = bmp GreyBmp.DestinationFormat = PixelFormats.Gray8 GreyBmp.EndInit() Dim im As BitmapSource = GreyBmp Image1.Source = im
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)