IImageLoadingService.FromStream(Stream, ImageFormat) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an image from the specified stream.
public Microsoft.Maui.Graphics.IImage FromStream(System.IO.Stream stream, Microsoft.Maui.Graphics.ImageFormat format = Microsoft.Maui.Graphics.ImageFormat.Png);
abstract member FromStream : System.IO.Stream * Microsoft.Maui.Graphics.ImageFormat -> Microsoft.Maui.Graphics.IImage
Public Function FromStream (stream As Stream, Optional format As ImageFormat = Microsoft.Maui.Graphics.ImageFormat.Png) As IImage
Parameters
- stream
- Stream
The stream containing the image data.
- format
- ImageFormat
The format of the image data (default is PNG).
Returns
An IImage created from the stream.
Exceptions
Thrown when stream
is null.
Thrown when the image data in the stream is invalid or cannot be decoded.