Articles in this section
Category / Section

How to show or hide Image Editor toolbar items?

4 mins read

 

SfImageEditor allows you to enable or disable the items in toolbar

 

Step 1: Create image editor 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: SetToolbarItemVisibility method is used to hide/show items in toolbar. Specify the name of the item in SetToolbarItemVisibility method as arguments, and set visibility value as true/false.

 

The following code snippet illustrates the way to this method,

 

Xaml:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:ImageEditor_GettingStarted"
             xmlns:editor="clr-
  namespace:Syncfusion.SfImageEditor.XForms;assembly=Syncfusion.SfImageEditor.XForms"
             x:Class="ImageEditor_GettingStarted.MainPage">
 
    <Grid>
        <editor:SfImageEditor Source="{Binding Image}"  x:Name="imageeditor">
        </editor:SfImageEditor>
    </Grid> 

 

 

C#

 

public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            BindingContext = new ImageModel();
            Editor.SetToolbarItemVisibility("redo,undo,text,path", false);
        }
    }    

 

You can also specify the single item or multiple items in SetToolbarItemVisibility method as arguments.

 

Code snippet

 

Editor.SetToolbarItemVisibility("redo", false);

 

 

Note:

 

The list of items in toolbar that can be hidden/shown by using SetToolbarItemVisibility method are follows.   

 

text, redo, undo, save, transform, rotate, shape, crop, path, circle, reset, and arrow          

     

 

Sample link:

 

http://www.syncfusion.com/downloads/support/directtrac/general/ze/ImageEditor_GettingStarted-1358939551.zip

 

 

Screenshot:     

 

 

             

                                                                           

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