ReadableBitmapDataExtensionsToSKBitmap(IReadableBitmapData, SKColorType, IQuantizer, IDitherer) Method

Converts the specified source to an SKBitmap that has the specified colorType.
See the Remarks section of the ToSKBitmap(IReadableBitmapData, SKColorType, SKAlphaType, WorkingColorSpace, IQuantizer, IDitherer) overload for details.

Definition

Namespace: KGySoft.Drawing.SkiaSharp
Assembly: KGySoft.Drawing.SkiaSharp (in KGySoft.Drawing.SkiaSharp.dll) Version: 9.1.0
C#
public static SKBitmap ToSKBitmap(
	this IReadableBitmapData source,
	SKColorType colorType,
	IQuantizer? quantizer,
	IDitherer? ditherer = null
)

Parameters

source  IReadableBitmapData
The source IReadableBitmapData instance to convert.
colorType  SKColorType
Determines the ColorType property of the result SKBitmap. Can be Unknown to auto select a color type that matches the source pixel format.
quantizer  IQuantizer
An optional IQuantizer instance to determine the colors of the result.
ditherer  IDitherer  (Optional)
The ditherer to be used. Might be ignored if quantizer is not specified and colorType represents a higher bits-per-pixel per color channel format. This parameter is optional.
Default value: .

Return Value

SKBitmap
An SKBitmap converted from the specified source.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadableBitmapData. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsource is .
ArgumentOutOfRangeExceptioncolorType does not specify a defined value.

See Also