How to remove the crop button in the toolbar?

Hello.


I need to remove the crop button in the toolbar of SfImageEditor.

How can I acheive this?


Thanks.


3 Replies 1 reply marked as answer

VO Vishal Omprasad Syncfusion Team July 4, 2023 01:18 PM UTC

Hi Ooni,

Your requirement can be met at the sample level. We have prepared a simple sample for your requirement, in which we have found the Crop element from the ToolBarItems collection removed that element as like in the below code snippet. We have attached the sample below for your reference.

[C#]

public MainWindow()

{

              InitializeComponent();

 

              foreach (var item in this.editor.ToolbarSettings.ToolbarItems)

              {

                             if (item.Name == "Crop")

                             {

                                           this.editor.ToolbarSettings.ToolbarItems.Remove(item);

                                           break;

                             }

              }

}


If the shared information doesn’t meet your requirement kindly revert us with more information, which will be helpful for us to provide you the better solution.

Regards,

Vishal O.


Attachment: ImageEditorDemo_89dbc6bf.zip

Marked as answer

OK Oono Kouichi July 5, 2023 12:26 AM UTC

Tanks a lot, it worked!



PR Preethi Rajakandham Syncfusion Team July 5, 2023 04:41 AM UTC

Hi Oono Kouichi,

You're welcome. We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help.

Regards,

Preethi R


Loader.
Up arrow icon