)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to enable Toggle cropping in ImageLoaded event

Platform: Xamarin.Forms |
Control: SfImageEditor |
Published Date: July 10, 2018 |
Last Revised Date: June 25, 2019

By default, In SfImageEditor, ToggleCropping method allow us to enable or disable cropping region over the image. From the below sample we can see how to enable the cropping region while initially loading the SfImageEditor. We can achieve this by using ImageLoaded event.

Step 1: Create SfImageEditor 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: Call the ToggleCropping method while ImageLoaded event get fired. Please refer the following code snippet.

Code Snippet:

editor.ImageLoaded += Editor_ImageLoaded; // Triger ImageLoaded event
private void Editor_ImageLoaded(object sender, ImageLoadedEventArgs args)
{
    editor.ToggleCropping();
}

 

Sample link:

 

http://www.syncfusion.com/downloads/support/directtrac/general/ze/IESample1742806067.zip 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
Marian Grzesik
Aug 31, 2018

When I use the code above, the controls shows the cropping view, but the header disappers, because the image covers the header, and I can't save the image. I've tried diffrent functions, to show the header like:


editor.ToolbarSettings.IsVisible = true;

editor.ToolbarSetting.HeaderToolbarHeight = 40;


It shows the header, but the upper part of the croping area is hidden.

I think it is a bug. I don't expect, that the Header disapears, when I switch to the cropping view.

Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon