SkiaBitmap.Save(CompressedBitmapFormat, float, Stream) method¶
Defined in
Type: SkiaBitmap
Namespace: Splat.SkiaSharp
Assembly: Splat.SkiaSharp.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-macos15.0, net9.0-desktop1.0, net9.0-ios18.0, net8.0, net8.0-maccatalyst17.5, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-macos14.5, netstandard2.1
Overloads¶
- 1.
public Task Save(CompressedBitmapFormat format, float quality, Stream target) - 2.
public Task Save(SKEncodedImageFormat format, float quality, Stream target)
1. Overload¶
public Task Save(CompressedBitmapFormat format, float quality, Stream target)
Inherited documentation
These docs were inherited from IBitmap. The member doesn't override them on this type.
Summary: Saves an image to a target stream.
Parameters
| Name | Type | Description |
|---|---|---|
format | [CompressedBitmapFormat](# | The format to save the image in. |
quality | float | If JPEG is specified, this is a quality factor between 0.0 and 1.0f where 1.0f is the best quality. |
target | Stream | The target stream to save to. |
Returns: Task -- A signal indicating the Save has completed.
2. Overload¶
public Task Save(SKEncodedImageFormat format, float quality, Stream target)
Summary: Saves the image in any format Skia can encode, rather than only the two CompressedBitmapFormat names.
Parameters
| Name | Type | Description |
|---|---|---|
format | SKEncodedImageFormat | The encoder to use. Which ones are built into the native library varies by platform. |
quality | float | A factor between 0 and 1, where 1 is the best quality. Lossless encoders ignore it. |
target | Stream | The stream to write the encoded image to. |
Returns: Task -- A task that completes once the encoded image has been written.
Exceptions
| Type | Condition |
|---|---|
| [Splat.BitmapLoaderException](# | The native library has no encoder for the requested format. |