Share via


SkiaImage.FromStream(Stream, ImageFormat) Method

Definition

Creates a new image from a stream.

public static Microsoft.Maui.Graphics.IImage FromStream(System.IO.Stream stream, Microsoft.Maui.Graphics.ImageFormat formatHint = Microsoft.Maui.Graphics.ImageFormat.Png);
static member FromStream : System.IO.Stream * Microsoft.Maui.Graphics.ImageFormat -> Microsoft.Maui.Graphics.IImage
Public Shared Function FromStream (stream As Stream, Optional formatHint As ImageFormat = Microsoft.Maui.Graphics.ImageFormat.Png) As IImage

Parameters

stream
Stream

The stream containing image data.

formatHint
ImageFormat

Optional hint about the image format.

Returns

A new IImage instance containing the image from the stream.

Exceptions

Thrown when the stream cannot be decoded as an image.

Applies to