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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Create new image

Thread ID:

Created:

Updated:

Platform:

Replies:

143338 Mar 14,2019 04:13 PM UTC Mar 20,2019 01:13 PM UTC UWP 3
loading
Tags: SfImageEditor
Christian
Asked On March 14, 2019 04:13 PM UTC

How can I create a new (blank) image with the ImageEditor?
It does not seem possible.

Muneesh Kumar G [Syncfusion]
Replied On March 15, 2019 05:23 AM UTC

Hi Christian, 
 
Greetings from Syncfusion. 
 
We have analyzed your requirement and you can achieve this by adding custom toolbar item to SfImageEditor and set ImageSource as null in ToobarItemSelected as per the below code snippet.  
 
Code snippet 
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"  > 
         
      <image:SfImageEditor x:Name="imageEditor" ImageSource="floordiagram.png"></image:SfImageEditor> 
         
    </Grid> 
 
public MainPage() 
        { 
            this.InitializeComponent(); 
 
            FooterToolbarItem toolbarItem = new FooterToolbarItem(); 
            toolbarItem.Text = "New"; 
            
            imageEditor.ToolbarSettings.ToolbarItems.Add(toolbarItem); 
 
            imageEditor.ToolbarSettings.ToolbarItemSelected += ToolbarSettings_ToolbarItemSelected; 
        } 
 
        private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e) 
        { 
            if (e.ToolbarItem.Text == "New") 
                imageEditor.ImageSource = null; 
        } 
 
We have prepared a sample based on this, please find the sample from the following location.  
 
 
Screenshot: 
 
 
Hope it helps you.  
 
Thanks, 
Muneesh Kumar G. 


Christian
Replied On March 15, 2019 11:20 AM UTC

Well, this does create a new image, but it crashes when you save the new image.
"Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection."

Reproduce:

1) Run the sample UWP_Sample-860035795
2) Click "New"
3) Draw a line on the blank canvas
4) Click "Save"

The problem is that the ImageEditor Stream is null.


Santhiya Arulsamy [Syncfusion]
Replied On March 20, 2019 01:13 PM UTC

Hi Christian, 
 
Sorry for the inconvenience caused. 
 
We can reproduce the issue and we confirmed “Exception thrown when saving the ImageEditor without adding the image” as an issue. We will provide the patch on 2nd April,2019. We appreciate your patience until then.  
You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  
 
Thanks, 
Santhiya A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

;