Share via


PlatformImage Class

Definition

Provides a platform-agnostic implementation of an image.

public ref class PlatformImage : IDisposable, Microsoft::Maui::Graphics::IImage
public class PlatformImage : IDisposable, Microsoft.Maui.Graphics.IImage
type PlatformImage = class
    interface IImage
    interface IDrawable
    interface IDisposable
Public Class PlatformImage
Implements IDisposable, IImage
Inheritance
PlatformImage
Implements

Constructors

PlatformImage(Byte[], ImageFormat)

Initializes a new instance of the PlatformImage class with the specified bytes and format.

Properties

Bytes

Gets the raw image data.

Height

Gets the height of the image.

Width

Gets the width of the image.

Methods

Dispose()

Releases all resources used by the image.

Downsize(Single, Boolean)

Downsizes the image to fit within the specified maximum dimension while maintaining aspect ratio.

Downsize(Single, Single, Boolean)

Downsizes the image to fit within the specified maximum width and height while maintaining aspect ratio.

Draw(ICanvas, RectF)
FromStream(Stream, ImageFormat)
Resize(Single, Single, ResizeMode, Boolean)

Resizes the image to the specified dimensions using the specified resize mode.

Save(Stream, ImageFormat, Single)

Saves the contents of this image to the provided Stream object.

SaveAsync(Stream, ImageFormat, Single)

Saves the contents of this image to the provided Stream object.

ToPlatformImage()

Extension Methods

AsBase64(IImage, ImageFormat, Single)
AsBytes(IImage, ImageFormat, Single)

Converts an image to a byte array in the specified format.

AsBytesAsync(IImage, ImageFormat, Single)
AsPaint(IImage)
AsStream(IImage, ImageFormat, Single)

Converts an image to a stream in the specified format.

Applies to