IReadWriteBitmapDataRowItem Property

KGy SOFT Drawing Libraries Help
Gets or sets the color of the pixel in the current row at the specified x coordinate.
See the Remarks section for details.

Namespace:  KGySoft.Drawing.Imaging
Assembly:  KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 5.1.0
Syntax

Color32 this[
	int x
] { get; set; }

Parameters

x
Type: SystemInt32
The x-coordinate of the pixel to set.

Property Value

Type: Color32
A Color32 instance that represents the color of the specified pixel.

Implements

IReadableBitmapDataRowItemInt32
Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionx is less than zero or is greater than or equal to the Width of the parent IReadWriteBitmapData.
Remarks

To return a Color structure you can use also the GetColor method but this member has a slightly better performance.

To set the color from a Color structure you can use also the SetColor method but this member has a slightly better performance.

The color value represents a straight (non-premultiplied) color with gamma correction γ = 2.2, regardless of the underlying PixelFormat. To access the actual PixelFormat-dependent raw data use the ReadRaw and WriteRaw methods.

If the color to be set is not supported by owner Bitmap, then it will be quantized to a supported color value.

Note Note
For information about the possible usable PixelFormats on different platforms see the Remarks section of the ConvertPixelFormat method.
Note Note
See the Examples section of the GetReadWriteBitmapData method for examples.
See Also

Reference