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

How to use Image Editor as signature?

Platform: Xamarin.Forms |
Control: SfImageEditor |
Published Date: January 12, 2018 |
Last Revised Date: June 25, 2019

Signature pads are used for users who often need to add signatures in documents. You can achieve this by using image editor. By using image editor control, you can achieve free hand drawing, erase the content, perform Undo, Redo, reset options, and save as image to device’s gallery.

 

Step 1: Create an image editor sample with all necessary assemblies.

 

Please refer the below link to create a simple SfImageEditor sample along with the ways to configure it.

 

https://help.syncfusion.com/xamarin/sfimageeditor/getting-started

 

Step 2: Create an instance for image editor. By default, image editor loads without image.

 

The following code snippet illustrates how to achieve this method by using image editor.

 

Xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="SfImageEditor_GettingStarted.SfimageEditor"
             xmlns:local="clr-namespace:SfImageEditor_GettingStarted"
             xmlns:imageeditor="clr-namespace:Syncfusion.SfImageEditor.XForms;assembly=Syncfusion.SfImageEditor.XForms">
  <Grid>
    <imageeditor:SfImageEditor Grid.RowSpan="6" x:Name="editor" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">     
    </imageeditor:SfImageEditor>
    
    <Button WidthRequest="50" Image="Reset.png" Clicked="Reset_Clicked" BorderRadius="20" BorderWidth="3" BackgroundColor="Transparent" Grid.Row="0" HorizontalOptions="End" VerticalOptions="Center"/>
 
    <Button WidthRequest="50" Image="Save.png" Clicked="Save_Clicked" BorderRadius="20" BorderWidth="3" BackgroundColor="Transparent" Grid.Row="1" HorizontalOptions="End" VerticalOptions="Center"/>
 
    <Button WidthRequest="50" Image="Pen.png" Clicked="Pen_Clicked" BorderRadius="20" BorderWidth="3" BackgroundColor="Transparent" Grid.Row="2" HorizontalOptions="End" VerticalOptions="Center"/>
 
    < Button  WidthRequest="50" Image="Eraser.png" Clicked="Eraser_Clicked" BorderRadius="20" BorderWidth="3" BackgroundColor="Transparent" Grid.Row="3" HorizontalOptions="End" VerticalOptions="Center"/>
 
    < Button WidthRequest="50" Image="Redo.png" Clicked="Redo_Clicked" BorderRadius="20" BorderWidth="3" BackgroundColor="Transparent" Grid.Row="4" HorizontalOptions="End" VerticalOptions="Center"/>
 
    < Button WidthRequest="50" Image="Undo.png" Clicked="Undo_Clicked" BorderRadius="20" BorderWidth="3" BackgroundColor="Transparent" Grid.Row="5" HorizontalOptions="End" VerticalOptions="Center"/>      
  
</Grid> 
</ContentPage>

 

 

 

C#

 

    public partial class SfimageEditor : ContentPage
    {
        public SfimageEditor()
        {
            InitializeComponent();
            this.editor.ToolbarSettings.IsVisible = false;
        }
 
        public void Pen_Clicked(object sender, EventArgs e)
        {
            editor.AddShape(Syncfusion.SfImageEditor.XForms.ShapeType.Path);
        }
        public void Undo_Clicked(object sender, System.EventArgs e)
        {
            editor.Undo();
        }
 
        public void Redo_Clicked(object sender, System.EventArgs e)
        {
            editor.Redo();
        }
 
        public void Reset_Clicked(object sender, System.EventArgs e)
        {
            editor.Reset();
        }
 
        public void Save_Clicked(object sender, System.EventArgs e)
        {
            editor.Save();
        }
 
        public void Eraser_Clicked(object sender, System.EventArgs e)
        {
            editor.AddShape(Syncfusion.SfImageEditor.XForms.ShapeType.Path, new Syncfusion.SfImageEditor.XForms.PenSettings() { Color = Color.White, StrokeWidth = 20 });
        }

 

Sample Link:

 

http://www.syncfusion.com/downloads/support/directtrac/general/ze/SfImageEditor_GettingStarted-1055011330.zip 

 

 

 

 

 

 

 

 

 

Screen Shot:

 

C:\Users\prakash.ramasamy\AppData\Local\Microsoft\Windows\INetCache\Content.Word\SingaturePad.png

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon