PeachDrawing

PeachDrawing.RasterSurfaceEncoding

RasterSurfaceEncoding.SaveAsync(RasterSurface, Stream, string, EncoderOptions, CancellationToken) Method

Encodes surface’s pixels (unpremultiplied first, since every PeachImage format expects straight alpha) into stream in any format PeachImage supports, for a standalone RasterCanvas canvas’s own Save. A fully opaque surface is encoded without an alpha channel, the same as EncodePng(RasterSurface, bool).

public static System.Threading.Tasks.Task SaveAsync(PeachDrawing.Core.RasterSurface surface, System.IO.Stream stream, string formatName, PeachImage.EncoderOptions options, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

surface RasterSurface

stream System.IO.Stream

formatName System.String

options EncoderOptions

cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task