using(Bitmap bitmap = new Bitmap("image.jpg", false))using(StreamWriter pixelFile = new StreamWriter("pixels.txt"))for(int y = 0; y < bitmap.Height; y++)for(int x = 0; x < bitmap.Width; x++){ pixelFile.Write("x: " + x + " y: " + y); Color c = bitmap.GetPixel(x, y); pixelFile.WriteLine(" color: R" + c.R + " G" + c.G + " B" + c.B);}
pictureBox1.Image = new Bitmap(dlg.OpenFile());((Bitmap)pictureBox1.Image).GetPixel(50.50);
Bitmap bmp = new Bitmap(dlg.OpenFile());pictureBox1.Image = bmp;bmp.GetPixel(50.50);