Bitmap.GetPixel

Bitmap.GetPixel method

Gets the color of the specified pixel in this Bitmap.

public Color GetPixel(int x, int y)
ParameterTypeDescription
xInt32The x-coordinate of the pixel to retrieve.
yInt32The y-coordinate of the pixel to retrieve.

Return Value

A Color structure that represents the color of the specified pixel.

Exceptions

exceptioncondition
ArgumentOutOfRangeExceptionx is less than 0, or greater than or equal to Width. ory is less than 0, or greater than or equal to Height
ExceptionThe operation failed.

See Also