ReadableBitmapDataExtensionsToSKBitmapAsync(IReadableBitmapData, SKColorType, SKAlphaType, IQuantizer, IDitherer, TaskConfig) Method
Converts the specified
source to an
SKBitmap asynchronously.
Namespace: KGySoft.Drawing.SkiaSharpAssembly: KGySoft.Drawing.SkiaSharp (in KGySoft.Drawing.SkiaSharp.dll) Version: 10.0.0-rc.1
public static Task<SKBitmap?> ToSKBitmapAsync(
this IReadableBitmapData source,
SKColorType colorType,
SKAlphaType alphaType,
IQuantizer quantizer,
IDitherer ditherer = null,
TaskConfig asyncConfig = null
)
<ExtensionAttribute>
Public Shared Function ToSKBitmapAsync (
source As IReadableBitmapData,
colorType As SKColorType,
alphaType As SKAlphaType,
quantizer As IQuantizer,
Optional ditherer As IDitherer = Nothing,
Optional asyncConfig As TaskConfig = Nothing
) As Task(Of SKBitmap)
public:
[ExtensionAttribute]
static Task<SKBitmap^>^ ToSKBitmapAsync(
IReadableBitmapData^ source,
SKColorType colorType,
SKAlphaType alphaType,
IQuantizer^ quantizer,
IDitherer^ ditherer = nullptr,
TaskConfig^ asyncConfig = nullptr
)
[<ExtensionAttribute>]
static member ToSKBitmapAsync :
source : IReadableBitmapData *
colorType : SKColorType *
alphaType : SKAlphaType *
quantizer : IQuantizer *
?ditherer : IDitherer *
?asyncConfig : TaskConfig
(* Defaults:
let _ditherer = defaultArg ditherer null
let _asyncConfig = defaultArg asyncConfig null
*)
-> Task<SKBitmap>
- 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.
- alphaType SKAlphaType
- Determines the AlphaType property of the result SKBitmap.
It might be ignored if the colorType cannot have the specified alpha type.
Can be Unknown to auto select an alpha 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: . - asyncConfig TaskConfig (Optional)
- The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When Progress is set in this parameter,
then this library always passes a DrawingOperation instance to the generic methods of
the IAsyncProgress interface. This parameter is optional.
Default value: .
TaskSKBitmapA task that represents the asynchronous operation. Its result is an
SKBitmap instance converted from the specified
source,
or
, if the operation was canceled and the
ThrowIfCanceled property of the
asyncConfig parameter was
.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).
This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1.