16 Oct 20245 minutes to read
To make the migration from the Xamarin SfImageEditor to the .NET MAUI SfImageEditor easier, most of the APIs from the Xamarin SfImageEditor are kept 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. Please find the difference in the following topics.
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;
...
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 annotation view bounds. |
EnableDrag
|
AllowDrag
|
Gets or sets a value indicating whether to enable drag action for annotation. |
IsResizable
|
AllowResize
|
Gets or sets a value indicating whether the resizing action is enabled or not for annotation. |
Opacity
|
Opacity
|
Gets or sets the opacity value. It ranges from 0 to 1. |
ImageEditorShapeSettings
Xamarin SfImageEditor |
.NET MAUI SfImageEditor |
Description |
Color
|
Color
|
Gets or sets the shape annotation color. |
StrokeWidth
|
StrokeThickness
|
Gets or sets the shape annotation stroke thickness. |
FillColor
|
IsFilled
|
Gets or sets a value indicating whether the color should be applied to the shape fill or stroke. |
ImageEditorTextSettings
ImageEditorTextStyle
Enums
Events
Methods
Xamarin SfImageEditor |
.NET MAUI SfImageEditor |
Description |
Rotate
|
Rotate
|
Method to rotate image 90 degrees in clockwise direction. |
Flip
|
Flip
|
Method to reverse the image along its horizontal or vertical axis. |
Crop
|
Crop
|
Method to select and remove a portion of the image. |
AddText
|
AddText
|
Method to add text to the image. |
AddShape
|
AddShape
|
Method to add shapes such as rectangles, circles, and lines to the image. |
Save
|
Save
|
Method to save the edited image. |
SaveEdits
|
SaveEdits
|
Method to save the current editing actions. |
Nil |
CancelEdits
|
Method to cancel the editing actions. |
ClearAnnotations
|
ClearAnnotations
|
Method to remove all the annotations. |
Reset
|
Reset
|
Method to reset the edited image to its initial stage. |
Undo
|
Undo
|
Method to reverse or undo the last action or a series of actions. |
Redo
|
Redo
|
Method to replay or redo an action or a series of actions that were previously undone using the "Undo" command. |
Delete
|
DeleteAnnotation
|
Method to remove the current selected annotations. |
GetStream
|
GetImageStream
|
Method to get the edited image stream |
ApplyImageEffect
|
ImageEffect
|
Method to apply 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 the images.
Known issues in .NET MAUI ImageEditor
- [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.