wardleb

I have an app which consists of a large picturebox. I am using managed C# code to load an image into the picturebox. What I would like to do now is draw a small square outline onto the middle of the image. Then I want to somehow get the color values of the pixels which are within this square. Can anyone guide me in the right direction or give me some code samples Thanks in advance.


Re: Smart Devices VB and C# Projects getting color info from image

ScubaSteve20001

All you have to do is convert the Image into a bitmap:


Bitmap bmp = new Bitmap(picBox.Image)

then use the Bitmap class' GetPixel() method to obtain the single pixel then you can call the various properties on the pixel object to obtain the color values of it