8 Jul 20265 minutes to read
To make migration easier from the Xamarin SfImageEditor to the .NET MAUI SfImageEditor, most of the APIs from Xamarin SfImageEditor have been retained in the .NET MAUI SfImageEditor. However, to maintain the consistency of API naming in the .NET MAUI SfImageEditor, some of the APIs have been renamed. The API changes from Xamarin SfImageEditor to .NET MAUI SfImageEditor are detailed as follows.
Namespaces
| Xamarin SfImageEditor |
.NET MAUI SfImageEditor |
| Syncfusion.SfImageEditor.XForms |
Syncfusion.Maui.ImageEditor |
Initialize control
To initialize the control, import the ImageEditor namespace and initialize the SfImageEditor as shown in the following code sample.
| Xamarin SfImageEditor |
.NET MAUI SfImageEditor |
<ContentPage
...
xmlns:imageEditor="clr-namespace:Syncfusion.XForms.ImageEditor;assembly=Syncfusion.SfImageEditor.XForms">
<imageEditor:SfImageEditor x:Name="imageEditor"/>
</ContentPage>
using Syncfusion.XForms.ImageEditor;
...
SfImageEditor imageEditor = new SfImageEditor();
this.Content = imageEditor;
|
<ContentPage
...
xmlns:imageEditor="clr-namespace:Syncfusion.Maui.ImageEditor;assembly=Syncfusion.Maui.ImageEditor">
<imageEditor:SfImageEditor x:Name="imageEditor"/>
</ContentPage>
using Syncfusion.Maui.ImageEditor;
…
SfImageEditor imageEditor = new SfImageEditor();
this.Content = imageEditor;
|
Classes
Properties
SfImageEditor
<ContentPage
...
xmlns:imageEditor="clr-namespace:Syncfusion.Maui.ImageEditor;assembly=Syncfusion.Maui.ImageEditor">
<imageEditor:SfImageEditor x:Name="imageEditor"
Source="syncfusion.png"/>
</ContentPage>
using Syncfusion.Maui.ImageEditor;
using Microsoft.Maui.Controls;
...
SfImageEditor imageEditor = new SfImageEditor();
imageEditor.Source = ImageSource.FromFile("syncfusion.png");
this.Content = imageEditor;
ImageEditorAnnotationSettings
| Xamarin SfImageEditor |
.NET MAUI SfImageEditor |
Description |
|
Bounds
|
Bounds
|
Gets or sets the bounds of the annotation view. |
|
EnableDrag
|
AllowDrag
|
Gets or sets a value indicating whether the drag action is enabled for the annotation. |
|
IsResizable
|
AllowResize
|
Gets or sets a value indicating whether the annotation can be resized. |
|
Opacity
|
Opacity
|
Gets or sets the opacity value, ranging from 0 to 1. |
ImageEditorShapeSettings
| Xamarin SfImageEditor |
.NET MAUI SfImageEditor |
Description |
|
Color
|
Color
|
Gets or sets the color of the shape annotation. |
|
StrokeWidth
|
StrokeThickness
|
Gets or sets the stroke thickness of the shape annotation. |
|
FillColor
|
IsFilled
|
Gets or sets a value indicating whether the shape is filled with the color. |
ImageEditorTextSettings
ImageEditorTextStyle
Enums
Events
Methods
| Xamarin SfImageEditor |
.NET MAUI SfImageEditor |
Description |
|
Rotate
|
Rotate
|
Rotates the image by 90 degrees in the clockwise direction. |
|
Flip
|
Flip
|
Reverses the image along its horizontal or vertical axis. |
|
Crop
|
Crop
|
Selects and removes a portion of the image. |
|
AddText
|
AddText
|
Adds text to the image. |
|
AddShape
|
AddShape
|
Adds shapes such as rectangles, circles, and lines to the image. |
|
Save
|
Save
|
Saves the edited image. |
|
SaveEdits
|
SaveEdits
|
Saves the current editing actions. |
| Nil |
CancelEdits
|
Cancels the current editing actions. |
|
ClearAnnotations
|
ClearAnnotations
|
Removes all annotations from the image. |
|
Reset
|
Reset
|
Resets the edited image to its initial state. |
|
Undo
|
Undo
|
Reverses (undoes) the last action or a series of actions. |
|
Redo
|
Redo
|
Re-applies an action or a series of actions that were previously undone using the 'Undo' command. |
|
Delete
|
DeleteAnnotation
|
Removes the currently selected annotations. |
|
GetStream
|
GetImageStream
|
Gets the edited image as a stream. |
|
ApplyImageEffect
|
ImageEffect
|
Applies various visual effects to the image, such as adjusted brightness, blur, contrast, exposure, saturation, sharpen, hue, and opacity. |
Upcoming features
- Support for pan and zoom improvements while performing the crop action on images.
Known issues in .NET MAUI Image Editor
- [Mac, iOS] The image is not loading correctly from the stream or URI binding source.
- Rotation not working for text annotation.
- [Mac, iOS] The
FontAttributes will not work for text annotations with the custom font family.
- Rotation will not work for custom annotation views.