Tip
See the Remarks section of the EncodeImage method for more details.
public static IAsyncResult BeginEncodeImage(
IReadableBitmapData imageData,
Stream stream,
IQuantizer? quantizer = null,
IDitherer? ditherer = null,
AsyncConfig? asyncConfig = null
)
Public Shared Function BeginEncodeImage (
imageData As IReadableBitmapData,
stream As Stream,
Optional quantizer As IQuantizer = Nothing,
Optional ditherer As IDitherer = Nothing,
Optional asyncConfig As AsyncConfig = Nothing
) As IAsyncResult
public:
static IAsyncResult^ BeginEncodeImage(
IReadableBitmapData^ imageData,
Stream^ stream,
IQuantizer^ quantizer = nullptr,
IDitherer^ ditherer = nullptr,
AsyncConfig^ asyncConfig = nullptr
)
static member BeginEncodeImage :
imageData : IReadableBitmapData *
stream : Stream *
?quantizer : IQuantizer *
?ditherer : IDitherer *
?asyncConfig : AsyncConfig
(* Defaults:
let _quantizer = defaultArg quantizer null
let _ditherer = defaultArg ditherer null
let _asyncConfig = defaultArg asyncConfig null
*)
-> IAsyncResult
In .NET Framework 4.0 and above you can use also the EncodeImageAsync method.
To finish the operation and to get the exception that occurred during the operation you have to call the EndEncodeImage method.
This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1. The encoding itself cannot be parallelized. The MaxDegreeOfParallelism setting affects only the quantizing session if imageData has a non-indexed pixel format, or when quantizer is set.
ArgumentNullException | imageData or stream is . |