Graphics.GetPixel Method

Gets the color of the specified pixel.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public Color GetPixel(
	int x,
	int y
)

Parameters

x

Type: System.Int32

The x-coordinate of the pixel to retrieve.
y

Type: System.Int32

The y-coordinate of the pixel to retrieve.

Return Value

A Color that represents the color of the specified pixel.

Remarks

If the current Graphics instance is opened for a device context, you should remember than not all devices have per-pixel access support. The coordinates must be inside the clipping region.

Note

This method works quite slow. It is ok to use it to get one color value, but if you need to process multiple pixels, it would be much faster to use direct access to memory.

See Also

Reference