BitmapEncoder.FlushAsync Method


Asynchronously commits and flushes all of the image data.

 virtual IAsyncAction ^ FlushAsync() = FlushAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction FlushAsync();
public IAsyncAction FlushAsync();
function flushAsync()
Public Function FlushAsync () As IAsyncAction



An object that manages the asynchronous flush operation.



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 (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.

Applies to