I have some picture, example:
and i want to get color of area in picture. example
but i don't know how to do that.
I have some picture, example:
and i want to get color of area in picture. example
but i don't know how to do that.
First, you cannot "generally" get the color of an area (unless you average the color of the area or some other manipulation). You will be looking for the color of a specific pixel.
From your Bitmap
, call GetPixel
with the X,Y
coordinates of the picture where you want to get the color. See documentation here.
Edit: from the comments, see this thread to invert the color, this should be pretty straight forward from the Color
returned by GetPixel
Take a look at the Bitmap.GetPixel
method and see if that's appropriate; to get an entire region's colour you'll just have to write a loop that goes from the top left to bottom right pixel and does the operation.
Anything more specific we'd have to know if you're using Winforms or WPF or if you're just loading a straight bitmap from disk.