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. Image for the cookie policy date

SFImageEditor.LoadEdits() does not load customViews


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

5 Replies

MK Muneesh Kumar G Syncfusion Team December 19, 2018 04:44 AM

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. 
Muneesh Kumar G. 

HA Hector Asencio December 19, 2018 08:06 AM

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. 

MK Muneesh Kumar G Syncfusion Team December 20, 2018 12:15 AM

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

MG Madhu Ganesh October 12, 2020 11:15 PM

Do you have a solution similar to this that works for Xamarin.Forms platform?

Thank you,

RS Ramya Soundar Rajan Syncfusion Team October 14, 2020 06:33 AM

Hi Madhu Ganesh, 
Currently we don’t have support to serialize and deserialize custom view in SfImageEditor. We have already added the feature request to serialize/deserialize the custom view. You can track the status of the feature from the below link. 
Please cast your vote to make it count. We will prioritize the features every release based on the demands and we do not have immediate plan to implement this feature since we committed with already planned work. So, this feature will be available any of our upcoming release.  
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal. 
Ramya S 

Live Chat Icon For mobile
Up arrow icon