Transformation in .NET MAUI Image Editor (SfImageEditor)
7 Jul 20262 minutes to read
The .NET MAUI Image Editor provides options for rotating and flipping images.
Rotate
The Rotate method rotates the image by 90 degrees clockwise on each invocation. You can rotate the image by using either the built-in toolbar or the Rotate method.
NOTE
The rotation angle cannot be specified in code.
<Grid RowDefinitions="0.9*, 0.1*">
<imageEditor:SfImageEditor x:Name="imageEditor"
Source="image.jpeg" />
<Button Grid.Row="1"
Text="Rotate"
Clicked="OnRotateImageClicked" />
</Grid>using Syncfusion.Maui.ImageEditor;
private void OnRotateImageClicked(object sender, EventArgs e)
{
this.imageEditor.Rotate();
}
Flip
The Flip method creates a mirror image by flipping the image horizontally or vertically based on the ImageFlipDirection enum. You can flip the image by using either the built-in toolbar or the Flip method.
- ImageFlipDirection - Specifies the direction in which to flip the image.
The following example uses the Flip method to flip the image vertically.
<Grid RowDefinitions="0.9*, 0.1*">
<imageEditor:SfImageEditor x:Name="imageEditor"
Source="image.jpeg" />
<Button Grid.Row="1"
Text="Flip"
Clicked="OnFlipImageClicked" />
</Grid>using Syncfusion.Maui.ImageEditor;
private void OnFlipImageClicked(object sender, EventArgs e)
{
this.imageEditor.Flip(ImageFlipDirection.Vertical);
}