CanvasImageSaveAsync Method (ICanvasImage, Rect, Single, ICanvasResourceCreator, IRandomAccessStream, CanvasBitmapFileFormat, Single) |
Namespace: Microsoft.Graphics.Canvas
public static IAsyncAction SaveAsync( ICanvasImage image, Rect sourceRectangle, float dpi, ICanvasResourceCreator resourceCreator, IRandomAccessStream stream, CanvasBitmapFileFormat fileFormat, float quality )
This method saves the given image. The image can be any size, memory or output file format permitting, and is not restricted by the value of CanvasDevice.MaximumBitmapSizeInPixels.
The ICanvasImage may need to be drawn to a render target before it can be saved - for example, it may be an effect or a command list. SaveAsync will take care of this automatically and create whatever temporary render targets are required.
The quality parameter defaults to 0.9, and only applies to the Jpeg and JpegXR formats.
To save an image using a high dynamic range (HDR) pixel format, use SaveAsync(ICanvasImage, Rect, Single, ICanvasResourceCreator, IRandomAccessStream, CanvasBitmapFileFormat, Single, CanvasBufferPrecision) with JpegXR format and a suitable CanvasBufferPrecision.