Hi Bernard,
Greetings from Syncfusion, we have analyzed your query and this issue occurs in Android because the ToggleCropping is called with a time delay in the sample to ensure that the image is loaded first and then the cropping Rect will appear. If the image is not loaded within the time the Crop Rect will not appear.
So, to overcome this we have provided a new event called ImageLoaded from our latest release 16.2 versions, this event will trigger only after the image is loaded in to the editor and then you can call ToggleCropping to show Cropping rect on the top of the image.
Based on this we have prepared a sample and it can be downloaded from the below link.
Hope this helps.
Thanks,
Michael
Dear Michael,
Thank you for your feedback. Today, I got a step further as the crop area is now indeed showing in Android. Great!
Unfortunately, on Android, the image stream of bytes returned when trying to save is just a black square. On iOS it works fine.
So, what did I do? Well, I adapted my code by adding the ImageLoaded event. However, for iOS the event is never called (bug?) so I had to leave the 'await Task.Delay(1000);' and editor?.ToggleCropping(1, 1);' code in the constructor. Doing this makes sure that both in iOS and Android I get an image and a crop area. So, this is progress.
The custom created crop button at the bottom calls a method which crops and saves the image when tapped.
The 'ImageSaving' event methods handles the capturing of the Stream bytes[].
For iOs this works perfectly well and I am able to get the cropped images bytes via the stream. On Android however, the returned byte stream is a black square.
So, how can I make this to work for Android. Attached my code for your review.
Thanks,
Bernard
Attachment:
CropPage_20180821_83f1c092.zip