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 save image to stream in UWP ImageEditor?

Platform: UWP |
Control: SfImageEditor |
Published Date: October 8, 2018 |
Last Revised Date: June 25, 2019

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:

 

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

2X faster development

The ultimate UWP UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

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