IReadableBitmapDataGetPColor32 Method

Gets the color of the pixel at the specified coordinates as a PColor32 value.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
C#
PColor32 GetPColor32(
	int x,
	int y
)

Parameters

x  Int32
The x-coordinate of the pixel to retrieve.
y  Int32
The y-coordinate of the pixel to retrieve.

Return Value

PColor32
A PColor32 instance that represents the color of the specified pixel.

Remarks

The returned value is a premultiplied color with 8 bits per channel in the sRGB color space, regardless of the underlying PixelFormat.

Line by line processing is also possible by obtaining the first row by the FirstRow property, getting the pixels by the IReadableBitmapDataRowMovable members and then moving to the next line by the MoveNextRow method.

To access the actual PixelFormat-dependent raw value you can use the ReadRaw method.

Exceptions

ObjectDisposedExceptionThis IReadableBitmapData has already been disposed.
ArgumentOutOfRangeExceptionx is less than zero or is greater than or equal to Width.
-or-
y is less than zero or is greater than or equal to Height.

See Also