Windows.Graphics.Imaging.BitmapEncoder.FlushAsync
September 2, 2020 ยท View on GitHub
-description
Asynchronously commits and flushes all of the image data.
-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 (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.