SfImageEditor crop not working [ios, android]

Hi,

After saving image is not cropped. 

In ImageLoaded event I've added crop to image editor control, selection of crop is showing correctly. I can resize and move selection.

void SfImageEditor_ImageLoaded(System.Object sender, EventArgs args)
{
var editor = sender as SfImageEditor;

editor.Crop(ImageCropType.Circle);
}


But after saving image have original size. Other editing (for example adding circle shape) is added to image correctly.

void SfImageEditor_ImageSaving(System.Object sender, ImageSavingEventArgs args)
{
args.Cancel = true;

try
{
var result = args.ImageStream;
var viewModel = BindingContext as SettingsPageViewModel;
if (viewModel != null)
{
viewModel.SaveCroppedPhoto(result);
}
}
catch (Exception ex)
{
Sentry.SentrySdk.CaptureException(ex);
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
}

1 Reply 1 reply marked as answer

VM Vidyalakshmi Mani Syncfusion Team March 1, 2024 02:40 PM UTC

Hi Natalia,


Thank you for reaching out to us. To ensure that the changes made during cropping are applied to the image, make sure to call the `SaveEdits` method after completing the crop operation. This method saves the cropping changes and updates the displayed image accordingly in the image editor.


For more information on the `SaveEdits` method, please refer to our UG documentation - Handling-the-cropping-tool


Please try this approach and let us know if it resolves your issue.


If you have any other questions or need further assistance, feel free to ask.


Regards,

Vidyalakshmi M.



Marked as answer
Loader.
Up arrow icon