Articles in this section
Category / Section

How to enable cropping using the image loaded event while loading the .NET MAUI Image Editor?

1 min read

Syncfusion .NET MAUI Image Editor (SfImageEditor) allows you to enable cropping while loading. This article demonstrates how to enable cropping on loading using the ImageLoaded event.

XAML:

Initiate the Image Editor control and provide the source image.

<imageEditor:SfImageEditor x:Name="imageEditor" Source="crop_onloading.png"/>

C#:

Trigger the ImageLoaded event in the MainPage.

public MainPage()
{
   InitializeComponent();
   imageEditor.ImageLoaded += ImageEditor_ImageLoaded;
}

C#:

Call the Crop method while triggering the ImageLoaded event to enable cropping while loading the image. Follow this code sample for a better understanding.

private void ImageEditor_ImageLoaded(object sender, EventArgs e)
{
   imageEditor.Crop(ImageCropType.Square);
}

Output:

CropOnLoading.png

Conclusion
I hope you enjoyed learning how to enable cropping using the ImageLoaded event while loading the .NET MAUI Image Editor (SfImageEditor).

Refer to our .NET MAUI ImageEditor’s feature tour page for other groundbreaking feature representations. You can also explore our .NET MAUI LinearGauge documentation to understand how to present and manipulate data.

For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion, try our 30-day free trial to check out our .NET MAUI Image Editor and other .NET MAUI components.

Please let us know in the following comment section if you have any queries or require clarifications. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied