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: