BitmapSourceExtensionsEndConvertPixelFormat Method

Waits for the pending asynchronous operation started by the BeginConvertPixelFormat methods to complete. In .NET Framework 4.0 and above you can use the ConvertPixelFormatAsync methods instead. To avoid blocking the source thread it is recommended to call this method from the CompletedCallback delegate of the asyncConfig parameter of the BeginConvertPixelFormat methods.
See the Remarks section of the BeginConvertPixelFormat(BitmapSource, PixelFormat, IQuantizer, IDitherer, AsyncConfig) method for details.

Definition

Namespace: KGySoft.Drawing.Wpf
Assembly: KGySoft.Drawing.Wpf (in KGySoft.Drawing.Wpf.dll) Version: 8.1.0
C#
public static WriteableBitmap? EndConvertPixelFormat(
	this IAsyncResult asyncResult
)

Parameters

asyncResult  IAsyncResult
The reference to the pending asynchronous request to finish.

Return Value

WriteableBitmap
A WriteableBitmap instance that is the result of the operation, or , if the operation was canceled and the ThrowIfCanceledproperty of the asyncConfig parameter was .

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncResult. 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).

Exceptions

ArgumentNullExceptionasyncResult is , or was not returned by a BeginConvertPixelFormat overload.
InvalidOperationExceptionA deadlock has been detected while attempting to create the result.

See Also