Share via


IImage.Resize(Single, Single, ResizeMode, Boolean) Method

Definition

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

public Microsoft.Maui.Graphics.IImage Resize(float width, float height, Microsoft.Maui.Graphics.ResizeMode resizeMode = Microsoft.Maui.Graphics.ResizeMode.Fit, bool disposeOriginal = false);
abstract member Resize : single * single * Microsoft.Maui.Graphics.ResizeMode * bool -> Microsoft.Maui.Graphics.IImage
Public Function Resize (width As Single, height As Single, Optional resizeMode As ResizeMode = Microsoft.Maui.Graphics.ResizeMode.Fit, Optional disposeOriginal As Boolean = false) As IImage

Parameters

width
Single

The target width in pixels.

height
Single

The target height in pixels.

resizeMode
ResizeMode

The resize mode to use (default is Fit).

disposeOriginal
Boolean

Whether to dispose the original image after resizing.

Returns

A new IImage with the resized dimensions.

Applies to