IWritableBitmapDataSetColorIndex Method

If this IWritableBitmapData has an indexed pixel format, then sets the color index of the pixel in the current row at the specified pixel.

Definition

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

Parameters

x  Int32
The x-coordinate of the color index to set.
y  Int32
The y-coordinate of the color index to set.
colorIndex  Int32
A palette index that represents the color to be set.

Remarks

This method can be used only if Indexed is set in the PixelFormat of this IWritableBitmapData. Otherwise, this method throws an InvalidOperationException.

To set the actual color of the pixel at the specified coordinates you can use the SetColor.../SetPColor... methods.

Exceptions

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.
InvalidOperationExceptionThis IWritableBitmapData does not have an indexed pixel format.

See Also