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

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

5 Replies

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



HA Hector Asencio 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. 


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



MG Madhu Ganesh October 13, 2020 04:15 AM UTC

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

Thank you,
Madhu


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

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. 
  
Regards, 
Ramya S 


Loader.
Live Chat Icon For mobile
Up arrow icon