pictureBox rgb values

  • Thread starter Thread starter yo mamma
  • Start date Start date
Y

yo mamma

Hello. I have a scanned document that I need to check certain
coordinates for rgb values (for example multiple choice questions). I'm
assuming that I can do this using a bitmap object, but I have no idea
where to start! Any help is greatly appreciated.

Regards,
Joe
 
Simply load the image into a new bitmap instance, then use the GetPixel
method, passing in your x and y coordinates to return a color value for that
pixel, from that you can poll it's R, G and B properties (as well as many
others), to find the information you want on it.

So your code would look something like...

Bitmap myBitmap = new Bitmap(@"C:\MyImage.jpg");
Color myPixel = myBitmap.GetPixel(x,y);

Brendan

//myPixel.R = Red value
//myPixel.G = Green value
//myPixel.B = Blue value
 
Back
Top