Skip to main content

ImageSavingHelper Class

Definition​

Assembly:Avalonia.Skia
Package:Avalonia.Skia

Helps with saving images to stream/file.

public class ImageSavingHelper

Inheritance: object -> ImageSavingHelper

Methods​

NameDescription
SaveImage (4 overloads)Saves a Skia image to a stream in the specified format.

SaveImage overloads​

SaveImage Method​

Saves a Skia image to a stream in the specified format.

public void SaveImage(SkiaSharp.SKImage image, System.IO.Stream stream, Avalonia.Media.Imaging.BitmapEncoderOptions options)
Parameters​

image SkiaSharp.SKImage

The image to save

stream System.IO.Stream

The output stream to save the image to.

options Avalonia.Media.Imaging.BitmapEncoderOptions

The options specifying the format and settings to use. Typical usages include Avalonia.Media.Imaging.PngBitmapEncoderOptions and Avalonia.Media.Imaging.JpegBitmapEncoderOptions.

SaveImage Method​

public void SaveImage(SkiaSharp.SKImage image, System.IO.Stream stream, Nullable<int> quality)
Parameters​

image SkiaSharp.SKImage

stream System.IO.Stream

quality Nullable<int>

SaveImage Method​

Saves a Skia image to a file in the specified format.

public void SaveImage(SkiaSharp.SKImage image, string fileName, Avalonia.Media.Imaging.BitmapEncoderOptions options)
Parameters​

image SkiaSharp.SKImage

The image to save

fileName string

The output file to save the image to.

options Avalonia.Media.Imaging.BitmapEncoderOptions

The options specifying the format and settings to use. Typical usages include Avalonia.Media.Imaging.PngBitmapEncoderOptions and Avalonia.Media.Imaging.JpegBitmapEncoderOptions.

SaveImage Method​

public void SaveImage(SkiaSharp.SKImage image, string fileName, Nullable<int> quality)
Parameters​

image SkiaSharp.SKImage

fileName string

quality Nullable<int>