Articles in this section
Category / Section

How can we set default cropping in image editor?

1 min read

 

SfImageEditor allows you to set default cropping in toolbar menu.

 

Step 1: Create SfImageEditor sample with all necessary assemblies.

 

Please refer the below link to create a simple SfImageEditor sample along with the ways to configure it.

https://help.syncfusion.com/xamarin/sfimageeditor/getting-started

 

Step 2: The list of cropping items are free, original, square, 3:1, 3:2, 4:3, 5:4, 16:9 in ImageEditor. You can set any crop item as default cropping. In SetToolbarItemVisibility method, disable the remaining items as false.

 

In the below code snippet, we have set 3:1 as default cropping in ImageEditor and disabled remaining items except 3:1.

 

C#

 

public MainPage()
  {
     InitializeComponent();
 
     Editor.Source = ImageSource.FromResource("ImageEditor_GettingStarted.Image.jpg");
 
     Editor.SetToolbarItemVisibility("free,square,original,3:2,4:3,5:4,16:9",false);
  }

 

 

Screen Shot:

 

Default cropping using xamarin SfImageEditor

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Sample link:

 

https://www.syncfusion.com/downloads/support/directtrac/general/ze/ImageEditor_GettingStarted-588940704.zip

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