Getting Started with UWP Image Editor (SfImageEditor)
25 May 20212 minutes to read
This section explains the steps required to load an image to the image editor. Image editor has a built-in toolbar that has options to edit the image with shapes, path, text, crop, rotate and flip.
After installing Essential Studio for UWP, you can find all the required assemblies in the installation folder,
SfImageEditor is available in the following assembly and namespace:
In addition, you have to install a
Win2Dpackage to save the image.
Initialize the image editor
- Import the SfImageEditor namespace as shown below,
- Initialize the image editor as shown below,
SfImageEditor editor = new SfImageEditor(); grid.Children.Add(editor);
Loading an image to the image editor
It can be done by the following two ways:
- Using bitmap object
- Using Stream
Using bitmap object
You can load an image to the control as a bitmap object.
IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read); BitmapImage bitMapImage = new BitmapImage(); image.SetSource(stream); imageEditor.ImageSource = bitMapImage;
You can load an image to the control as a stream.
IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read); imageEditor.Image = stream;
- After an image has been loaded to the SfImageEditor, you can start to edit an image by using the built-in Toolbar