Tip
See the Remarks section of the ConvertPixelFormat(Image, PixelFormat, Color, Color, Byte) method for more details and image examples.
public static IAsyncResult BeginConvertPixelFormat(
this Image image,
PixelFormat newPixelFormat,
Color[]? palette,
Color backColor = default,
byte alphaThreshold = 128,
AsyncConfig? asyncConfig = null
)
<ExtensionAttribute>
Public Shared Function BeginConvertPixelFormat (
image As Image,
newPixelFormat As PixelFormat,
palette As Color(),
Optional backColor As Color = Nothing,
Optional alphaThreshold As Byte = 128,
Optional asyncConfig As AsyncConfig = Nothing
) As IAsyncResult
public:
[ExtensionAttribute]
static IAsyncResult^ BeginConvertPixelFormat(
Image^ image,
PixelFormat newPixelFormat,
array<Color>^ palette,
Color backColor = Color(),
unsigned char alphaThreshold = 128,
AsyncConfig^ asyncConfig = nullptr
)
[<ExtensionAttribute>]
static member BeginConvertPixelFormat :
image : Image *
newPixelFormat : PixelFormat *
palette : Color[] *
?backColor : Color *
?alphaThreshold : byte *
?asyncConfig : AsyncConfig
(* Defaults:
let _backColor = defaultArg backColor new Color()
let _alphaThreshold = defaultArg alphaThreshold 128
let _asyncConfig = defaultArg asyncConfig null
*)
-> IAsyncResult
In .NET Framework 4.0 and above you can use also the ConvertPixelFormatAsync(Image, PixelFormat, Color, Color, Byte, TaskConfig) method.
To get the result or the exception that occurred during the operation you have to call the EndConvertPixelFormat method.
This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1.