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

SFImageEditor.LoadEdits() does not load customViews

Thread ID:

Created:

Updated:

Platform:

Replies:

141574 Dec 18,2018 06:54 PM UTC Dec 20,2018 05:15 AM UTC UWP 3
loading
Tags: SfImageEditor
Hector Asencio
Asked On December 18, 2018 06:54 PM UTC

Hello, 

I am working on an application that uses SfImageEditor. I am working on saving and loading the edits on the image using the serialization methods of the control. 
I have no problem when the edits are lines, texts, or even the shapes that we can use in the control. However when I create a customView  and add itusing AddCustomView, when I save the edits and reload it, it doesn't show the custom view. And when I insert the customview manually it appears in the position ofthe view that was supposed to show when I called LoadEdits().

Is there any way of loading the custonViews using these methods? Or Am I missing something that needs to be defined or declare so that it will find the custom view That its supposed to load?

Thank You in advance

Muneesh Kumar G [Syncfusion]
Replied On December 19, 2018 09:44 AM UTC

Hi Hector, 
 
Thanks for using Syncfusion products.  
 
We have validated your query and we have created sample to achieve your requirement. Please find the sample from below link. 
 
Sample Link: 
 
 
  
In this sample, we have done the following things, 
 
1.      Added CustomView as button. To serialize the custom view, we need to give name for custom view as like below code snippet.  
 
Ieditor.AddCustomView(new Button() { Name = "buttonView", Content = "Custom View", Height = 70, Width = 100, Background = new SolidColorBrush(Colors.Green) }, new 
 
  
2.      Called SaveEdits() method to serialize the custom view as like below code snippet 
 
Var tempStream = Ieditor.SaveEdits(); 
 
  
3.      Implemented custom controller class to deserialize the custom view as like below code snippet 
 
public class CustomController : DeserializationController 
    { 
        public override FrameworkElement GetCustomView(string name) 
        { 
            if (name == "buttonView") 
                return (new Button() { Name = "buttonView", Content = "Custom View", Height = 70,  Width = 100, Background = new SolidColorBrush(Colors.Green) }); 
            return null; 
        } 
    } 
  
 
  
4.      Added LoadEdits() method  as like below code snippet 
 
CustomController controller = new CustomController(); 
            if (tempStream != null) 
                Ieditor.LoadEdits(tempStream, controller); 
 
  
  
Please let us know, if you have any queries. 
 
Regards, 
Muneesh Kumar G. 


Hector Asencio
Replied On December 19, 2018 01:06 PM UTC

Thank you very much Kumar,

I apply your solution to my project and it work. I simply modify it tu use images instead of a button. The solution work as its supposed to. 

Muneesh Kumar G [Syncfusion]
Replied On December 20, 2018 05:15 AM UTC

Hi Hector, 
 
Glad that the issue has been resolved and please get back to us if you need any other assistance.  
 
Thanks,
Muneesh Kumar G.
 


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

;