How to set Crop Menu by default in SfImageEditor

Please help me to set Crop by default in sfimage editor 


3 Replies

ET Eswaran Thirugnanasambandam Syncfusion Team September 27, 2021 09:43 AM UTC

Hi Shahid Abbas, 
 
Greetings from Syncfusion. 
 
We would like to inform you that, SfImageEditor having methods to toggle the cropping programmatically. So, by using that you can achieve your requirement. In order to enabling cropping by default, you can call the ToggleCropping method from the ImageLoaded event of SfImageEditor as mentioned in the below code snippet. 
 
private void SfImageEditor_ImageLoaded(object sender, Syncfusion.SfImageEditor.XForms.ImageLoadedEventArgs args) 
{ 
    editor.ToggleCropping(true); 
} 
 
Based on your requirement we have prepared a sample to show crop menu on loading. Please get the sample from the below link 
 
For additional details on crop support in SfImageEditor, see the user guide documentation link below.  
 
Please check the sample and let us know if you need any further assistance.  
  
Regards, 
Eswaran 



SA Shahid Abbas October 2, 2021 02:54 PM UTC

Can show only free crop and all other crop menus hidden 



ET Eswaran Thirugnanasambandam Syncfusion Team October 4, 2021 11:17 AM UTC

Hi Shahid Abbas, 
 
Thanks for your update, 
 
We have checked your requirement and it can be achieved using the SetToolbarItemVisibility method of SfImageEditor. Using this method, we can hide or show the toolbar items by specifying the icon names and setting the Boolean values to true or false as mentioned in the below code snippet. 
[C#] 
editor.SetToolbarItemVisibility("Original, Square, Circular, Ellipse, 3:1, 1:3, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16", false); 
 
 
 
We have modified the previous sample to show only the free crop toolbar when loading the image editor control. Please get it from the below link. https://www.syncfusion.com/downloads/support/directtrac/general/ze/GSImageEditor-231691109  
 
Please refer the below user guide documentation for more information. 
 
Please let us know if you need any further assistance.  
  
Regards, 
Eswaran 


Loader.
Up arrow icon