Get PixelValue when click on a picturebox
I'm working on a .NET C# project and would like to get the pixel value when I click a picturebox, how can I achieve that? The basic idea is that when I click anywhere in the picturebox, I get the pixelvalue of that image point.. Thanks! Use this: private void pictureBox2_MouseUp(object sender, MouseEventArgs e) { Bitmap b = new Bitmap(pictureBox1.Image); Color color = b.GetPixel(e.X, e.Y); } As @Hans pointed out Bitmap.GetPixel should work unless you have different SizeMode than PictureBoxSizeMode.Normal or PictureBoxSizeMode.AutoSize . To make it work all the time let's access private