BitmapEncoder.FlushAsync BitmapEncoder.FlushAsync BitmapEncoder.FlushAsync BitmapEncoder.FlushAsync BitmapEncoder.FlushAsync Method

Definition

Asynchronously commits and flushes all of the image data.

public : IAsyncAction FlushAsync()
IAsyncAction FlushAsync() const;
public IAsyncAction FlushAsync()
Public Function FlushAsync() As IAsyncAction
Windows.Graphics.Imaging.BitmapEncoder.flushAsync().done( /* Your success and error handlers */ );

Returns

An object that manages the asynchronous flush operation.

Remarks

Call this method when you are done encoding and before you close the output stream. The minimum data you need to set on a new image before calling FlushAsync is the pixel data (@Windows.Graphics.Imaging.BitmapEncoder.SetPixelData(Windows.Graphics.Imaging.BitmapPixelFormat,Windows.Graphics.Imaging.BitmapAlphaMode,System.UInt32,System.UInt32,System.Double,System.Double,System.Byte[])?text=SetPixelData ). After this method is called, any subsequent calls to BitmapEncoder methods will fail.

If, after encoding is complete, you want to reuse the IRandomAccessStream from which the BitmapEncoder was created, such as passing it to the Windows.Storage.Compression APIs, you must first reset the stream's seek position to 0, the start of the stream, by calling IRandomAccessStream.Seek.