We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to use the editor built-in slider for custom functions?

Good afternoon, i'm developing a software that uses SfImageEditor, i'm developing custom functions and i need a slider in order to make an image threshold filter.

There is a way to use the editor built-in slider? (i mean the slider that appears when you need to change the pencil size or transparency)

Thanks in advance

1 Reply

RA Rachel A Syncfusion Team August 6, 2019 11:24 AM UTC

Hi Marco, 
 
Greetings from Syncfusion. 
 
We are not able to change the default functionality of toolbar’s built in slider. We would like to inform that, the ImageEditor having support for adding custom ToolBarItem (it does not have support to add custom views like button, slider, etc). So, you can achieve your requirement by adding custom toolbar item in footer toolbar, adding slider at the bottom of the image editor and control its visibility from the custom toolbar item. Please find the code snippet below 
 
[XAML]: 
 
<imageeditor:SfImageEditor.ToolbarSettings> 
    <imageeditor:ToolbarSettings ToolbarItemSelected="ToolbarSettings_ToolbarItemSelected"> 
        <imageeditor:ToolbarSettings.ToolbarItems> 
            <imageeditor:FooterToolbarItem Name="threshold" Icon="SendBack.png" /> 
        </imageeditor:ToolbarSettings.ToolbarItems> 
    </imageeditor:ToolbarSettings> 
</imageeditor:SfImageEditor.ToolbarSettings> 
 
 
[C#]: 
 
private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e) 
{ 
    var footertoolBar = e.ToolbarItem; 
    if (footertoolBar != null) 
    { 
        if (footertoolBar.Name == "threshold") 
        { 
            this.ThresholdFilterSlider.IsVisible = !this.ThresholdFilterSlider.IsVisible; 
        } 
    } 
} 
 
private void ThresholdFilterSlider_ValueChanged(object sender, ValueChangedEventArgs e) 
{ 
    // Your action here. 
} 
 
 
Please find the sample from the below link. 
 
For more information about toolbar customization. Please refer the below User Guide link. 
 
Regards, 
Rachel. 


Loader.
Live Chat Icon For mobile
Up arrow icon