Tip
See the Remarks section of the ConvertPixelFormat(Image, PixelFormat, IQuantizer, IDitherer) method for more details and image examples.
public static Task<Bitmap?> ConvertPixelFormatAsync(
this Image image,
PixelFormat newPixelFormat,
IQuantizer? quantizer,
IDitherer? ditherer = null,
TaskConfig? asyncConfig = null
)
<ExtensionAttribute>
Public Shared Function ConvertPixelFormatAsync (
image As Image,
newPixelFormat As PixelFormat,
quantizer As IQuantizer,
Optional ditherer As IDitherer = Nothing,
Optional asyncConfig As TaskConfig = Nothing
) As Task(Of Bitmap)
public:
[ExtensionAttribute]
static Task<Bitmap^>^ ConvertPixelFormatAsync(
Image^ image,
PixelFormat newPixelFormat,
IQuantizer^ quantizer,
IDitherer^ ditherer = nullptr,
TaskConfig^ asyncConfig = nullptr
)
[<ExtensionAttribute>]
static member ConvertPixelFormatAsync :
image : Image *
newPixelFormat : PixelFormat *
quantizer : IQuantizer *
?ditherer : IDitherer *
?asyncConfig : TaskConfig
(* Defaults:
let _ditherer = defaultArg ditherer null
let _asyncConfig = defaultArg asyncConfig null
*)
-> Task<Bitmap>
Alternatively, you can also use the BeginConvertPixelFormat(Image, PixelFormat, IQuantizer, IDitherer, AsyncConfig) method, which is available on every platform.
This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1.