Articles in this section
Category / Section

How to save image to stream in UWP ImageEditor?

1 min read

Description:

In SfImageEditor we can save image as a stream, Using ImageSaving event.

Solution:

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/uwp/sfimageeditor/getting-started

 

Step 2: Use ImageSaving event to get stream while saving the image.

 

The following code snippet illustrates the way to this method,

 

Code Snippet:

 

private void editor_ImageSaving(object sender, ImageSavingEventArgs args)
{
    IRandomAccessStream stream = args.Stream.AsRandomAccessStream();
    stream.Seek(0);
    var bitmap = new BitmapImage();
    bitmap.SetSourceAsync(stream);
    ImageStream.Source = bitmap;
}

 

Sample link:

 

https://www.syncfusion.com/downloads/support/directtrac/general/ze/ImageEditor_GettingStarted1475010632.zip

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied