This documentation is for the old version. Go to the latest Graphics Mill docs

GdiGraphics.GetPixel Method

Gets a color of a pixel at specified coordinates.

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

Syntax

Visual Basic
Public Function GetPixel ( _
	x As Integer, _
	y As Integer _
) As Color
C#
public Color GetPixel(
	int x,
	int y
)

Parameters

x

Type: System.Int32

Horizontal coordinate of the required pixel.
y

Type: System.Int32

Vertical coordinate of the required pixel.

Return Value

A color of the pixel at specified coordinates.

Remarks

If the current GdiGraphics instance is opened for a device context, you should remember than not all devices have per-pixel access support. Also, 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