SfImageEditor saving edited image into I/O Stream

Hi,

I love SfImageEditor and it is a great control that save a lot of my work. But, it will even greater if it does support saving the edited image into the I/O Stream object supply by the user code/application. This will avoid the edited image being save into Photo Gallery/Camera Roll.

Regards,
CT

5 Replies

MP Michael Prabhu M Syncfusion Team September 17, 2018 05:38 AM UTC

Hi  CT, 
 
Greetings from Syncfusion, 
 
We already have support to avoid saving images in gallery. We have an event called ImageSaving, which helps to avoid saving image in to gallery also we can get the stream of the image as per your exact requirement. We have prepared sample for this and find the sample from below location 
 
 
Code snippet: 
 
private void Editor_ImageSaving(object sender, ImageSavingEventArgs args)
{
   args.Cancel = true; // To avoid the image saved into pictures library
   var stream = args.Stream;// To get I/O stream from saving event argument
}
 
 
You can refer the following document to know more about SfImageEditor. 
 
 
Thanks, 
Michael 
 
 



MG Marian Grzesik September 20, 2018 04:16 PM UTC

Hi,

the code works fine, but if I use the function ToggleCropping and than Crop, I get only a white rectangle. I've tested it on Android 8.1 / Nexus 5X.

Could you please include an example, how to get the stream in this mode. I hide the toolbar and use only my buttons to save the cropping area. I don't want also  to save the image in the picture library.

Thanks
Marian


CC CT CHANG September 20, 2018 11:28 PM UTC

Hi Michael,

Thank and that help! What a silly mistake I made... I did not call the args.Cancel = true.

Regards,
CT


MP Michael Prabhu M Syncfusion Team September 21, 2018 05:56 AM UTC

Hi Marian,

 

Thanks for the update.

 

We have created sample to achieve your requirement and find the sample from below location 

 

http://www.syncfusion.com/downloads/support/directtrac/general/ze/cropsam-851668137.zip

 

In the above sample, we have called ToggleCropping method in button click and then crop with save in another button click. The resulted stream will be shown in Image View. But we are not able to reproduce white rectangle.

 

Please let us know if you have any clarifications in the sample.

 

Thanks,

Michael



MP Michael Prabhu M Syncfusion Team replied to CHANG CHIEW THOU September 21, 2018 05:57 AM UTC

Hi Michael,

Thank and that help! What a silly mistake I made... I did not call the args.Cancel = true.

Regards,
CT

Hi CT,

Glad we could help, feel free to contact us if you need any other assistance.

Thanks,
Michael

Loader.
Up arrow icon