ImageEditor - CustomView example

Hi,

I consulted the documentation and I not founded nothing about CustomView in ImageEditor component. Please, is possible send me on example code or documentation.

Thanks

5 Replies

RS Ramya Soundar Rajan Syncfusion Team February 20, 2020 07:09 AM UTC

Hi Henrique,   
   
Greetings from Syncfusion.   
   
We hope below UG link will guide you to achieve your requirement “Add CustomView to ImageEditor”  
   
 
Please let us know if you need any further assistance and please don't hesitate to contact us.  
 
Regards, 
Ramya S 



HE Henrique February 20, 2020 11:11 PM UTC

Hi,

I put this code in and the custom view is not displayed in the component.

 public AortaAbdominal()
        {
            InitializeComponent();

            Image customImage = new Image() { HeightRequest = 200, WidthRequest = 200 };
            Assembly assembly = Assembly.GetAssembly(typeof(Image)); ---> I think this SAMPLE is Image object!!!

            customImage.Source = ImageSource.FromResource("com.Cartografia.Images.fistulaarteriovenosa.png", assembly);

            sftEditor.AddCustomView(customImage, new CustomViewSettings());
        }


DD Devakumar Dhanapoosanam Syncfusion Team February 21, 2020 09:36 AM UTC

Hi Henrique, 
 
Thanks for your update. 
 
We have checked the same but we were unable to reproduce. Please refer the below code snippet for adding the custom image in the SfImageEditor
 
C#: 
namespace IESample 
    class ImageModel 
   
        public ImageSource Image { get; set; } 
 
        public ImageModel() 
       
            Assembly assembly = typeof(ImageModel).GetTypeInfo().Assembly; 
            Image = ImageSource.FromResource("IESample.Image.jpeg", assembly); 
       
   
 
XAML: 
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
             x:Class="IESample.GettingStarted" 
             xmlns:local="clr-namespace:IESample" 
             xmlns:imageeditor="clr- 
               namespace:Syncfusion.SfImageEditor.XForms;assembly=Syncfusion.SfImageEditor.XForms"> 
     <ContentPage.BindingContext> 
          <local:ImageModel/> 
     </ContentPage.BindingContext> 
     <ContentPage.Content> 
           <imageeditor:SfImageEditor Source="{Binding Image}" /> 
     </ContentPage.Content> 
</ContentPage> 
 
Screenshot: 
 
 
Please let us know if you need any further assistance on this and please don't hesitate to contact us. 
 
Regards, 
Devakumar D 



HE Henrique February 21, 2020 01:26 PM UTC

Devakumar,

I am refer how to view the CustomView in Image Editor. Your example refer to initial load image. 

I analyzed the submitted documentation and I couldn't understand which object is SAMPLE and why CustomView is not showing up in my implementation.

(Assembly assembly = Assembly.GetAssembly(typeof(Image)); ---> I think this SAMPLE is Image object!!!)

Please, return to me with a one solution about don't view CustomView.

Tks


RS Ramya Soundar Rajan Syncfusion Team February 24, 2020 09:25 AM UTC

Hi Henrique, 
 
We have prepared a sample to add CustomView on image as like in below code. 
 
[XAML]: 
 
        <syncfusion:SfImageEditor x:Name="editor" Source="{Binding Image}" Grid.Row="1"> 
        </syncfusion:SfImageEditor> 
 
 
[C#]: 
            Image customImage = new Image() { HeightRequest = 200, WidthRequest = 200 }; 
            Assembly assembly = Assembly.GetAssembly(typeof(GettingStarted)); 
            customImage.Source = ImageSource.FromResource("IESample.ITypogy1.png", assembly); 
            editor.AddCustomView(customImage, new CustomViewSettings()); 
 
Note: Mentioned GettingStarted, IESamples are class name and namespace names, respectively.  
 
Query:  I couldn't understand which object is SAMPLE 
 
Please refer the below screenshot. 
 
 
Sample Link: 
 
 
Output Screenshot: 
 
 
 
Regards, 
Ramya S 


Loader.
Up arrow icon