QuantizerExtensionsInitializeAsync Method
Gets an
IQuantizingSession instance potentially asynchronously that can be used to quantize the colors of the specified
IReadableBitmapData instance.
If
quantizer is a known quantizer that can be evaluated quickly, then this method might be executed synchronously.
This method is available in.NET Framework 4.0 and above.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
public static Task<IQuantizingSession?> InitializeAsync(
this IQuantizer quantizer,
IReadableBitmapData source,
TaskConfig? asyncConfig = null
)
<ExtensionAttribute>
Public Shared Function InitializeAsync (
quantizer As IQuantizer,
source As IReadableBitmapData,
Optional asyncConfig As TaskConfig = Nothing
) As Task(Of IQuantizingSession)
public:
[ExtensionAttribute]
static Task<IQuantizingSession^>^ InitializeAsync(
IQuantizer^ quantizer,
IReadableBitmapData^ source,
TaskConfig^ asyncConfig = nullptr
)
[<ExtensionAttribute>]
static member InitializeAsync :
quantizer : IQuantizer *
source : IReadableBitmapData *
?asyncConfig : TaskConfig
(* Defaults:
let _asyncConfig = defaultArg asyncConfig null
*)
-> Task<IQuantizingSession>
- quantizer IQuantizer
- An IQuantizer instance to get an IQuantizingSession for.
- source IReadableBitmapData
- The quantizing session to be initialized will be performed on the specified IReadableBitmapData instance.
- asyncConfig TaskConfig (Optional)
- The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc. This parameter is optional.
Default value: .
TaskIQuantizingSessionA task that represents the asynchronous operation. Its result is an
IQuantizingSession instance that can be used to quantize the colors of the specified
IReadableBitmapData instance
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
IQuantizer. 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).