Toolbar customization

Hello,

I would like to have only two functions in the bottom toolbar. 4:3 crop and rotate. Is it possible to move only these two to the bottom toolbar from sub toolbar?

Pawel


1 Reply

ET Eswaran Thirugnanasambandam Syncfusion Team September 3, 2021 01:38 PM UTC

Hi Pawel, 
 
Greetings from Syncfusion. 
 
We have analysed your query and you can achieve your requirement by hiding all the footer toolbar items using the SetToolbarItemVisibility() method and add the required items in the footer toolbar as custom toolbar items as like in the below snippet. 
[C#] 
editor.SetToolbarItemVisibility("Transform,Path,text,shape,Effects", false); 
  
ToolBarSetting has the support to add custom footer toolbar items has mentioned in the below code snippet. 
 
[C#] 
editor.ToolbarSettings.ToolbarItems.Add(new FooterToolbarItem() { Text = "4:3" }); 
editor.ToolbarSettings.ToolbarItems.Add(new FooterToolbarItem() {Text = "Rotate" }); 
 
Using the toolbar item selected event we can add the functionality for the new added custom toolbars as mentioned in the below code snippet. 
 
[C#] 
private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e) 
        { 
            if (e.ToolbarItem.Text == "4:3") 
            { 
                // Crops the image in 4:3 ratio. 
                editor.ToggleCropping(4, 3); 
            } 
            else if (e.ToolbarItem.Text == "Rotate") 
            { 
                // Rotate the Images. 
                editor.Rotate(); 
            } 
        } 
 
Please refer the below User Guide links to know more details 
 
Based on your requirement, we have prepared a sample. Please get it from the below link. 
 
Screenshot: 
 
 
  
 
Please let us know if you need any assistance.  
  
Regards, 
Eswaran 


Loader.
Up arrow icon