Skip to main content

Class ImageSavingHelper

Namespace: Avalonia.Skia.Helpers
Assembly: Avalonia.Skia.dll

Helps with saving images to stream/file.

public static class ImageSavingHelper

Inheritance

objectImageSavingHelper

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

SaveImage(SKImage, string, int?)

Save Skia image to a file.

public static void SaveImage(SKImage image, string fileName, int? quality = null)

Parameters

image SKImage

Image to save

fileName string

Target file.

quality int?

The optional quality for PNG compression. The quality value is interpreted from 0 - 100. If quality is null the encoder applies the default quality value.

SaveImage(SKImage, Stream, int?)

Save Skia image to a stream.

public static void SaveImage(SKImage image, Stream stream, int? quality = null)

Parameters

image SKImage

Image to save

stream Stream

The output stream to save the image.

quality int?

The optional quality for PNG compression. The quality value is interpreted from 0 - 100. If quality is null the encoder applies the default quality value.