Forum Xamarin.Forms

Signature Pad for Xamarin.Forms

2»

Posts

  • PulseMobile2PulseMobile2 GBMember
    edited February 2016

    Sorry Allan, won't do that again

  • nbevansnbevans USMember ✭✭✭

    I think there is now scope to rebuild SignaturePad on top of SkiaSharp. Target all the platforms from one core implementation.

  • hopikopitariumhopikopitarium USMember

    @nbevans said:

    I think there is now scope to rebuild SignaturePad on top of SkiaSharp. Target all the platforms from one core implementation.

    Hey,

    Can you explain more what do you mean by that?

    Thanks!

  • anandjitbanerjee.5636anandjitbanerjee.5636 USUniversity ✭✭
    edited May 2016

    I am using the following code to get the signature image and show it to the user.
    var inputStream = signPadAfterWork.GetImage(ImageFormatType.Jpg); var buffer = new Byte[inputStream.Length]; var bytesRead = inputStream.Read(buffer, 0, (int)inputStream.Length); viewModel.SignatureTwoImageBytes = buffer;
    imgSignBeforeWork.Source = ImageSource.FromStream(() => new MemoryStream(viewModel.SignatureOneImageBytes));
    It works on iOS but not on android.Any suggestions?

  • anslemarnoldaanslemarnolda USMember

    Im also having the same issue in reading the signature, Someone please.

  • XasanrahXasanrah CZMember ✭✭

    @Andrew.4149 said:
    I thought it was transparency problem because images were showing up with black background in Crystal Reports. But then I saved image to SD card and realized they had a black background with jpegs which don't support transparency. Then I found the real problem. I didn't set the stroke and fill color. See below.

    signature.GetImage(Color.Black, Color.White)

    Thanks that helps me too

  • RichardLeonardRichardLeonard GBMember ✭✭

    Has anyone successfully managed to convert the imagestream to a byte array on the Android platform in a PCL?

    This works on iOS but I get an empty Byte Array on Android :

    var sig = await padView.GetImageStreamAsync(SignaturePad.Forms.SignatureImageFormat.Jpg);
    byte[] data = null;
    
    BinaryReader br = new BinaryReader(sig);
    data = br.ReadBytes((int)sig.Length); 
    
  • RichardLeonardRichardLeonard GBMember ✭✭

    Might help somebody but managed to get it working by using the following code and cast the steam to a MemoryStream:

    var sig = await padView.GetImageStreamAsync(SignaturePad.Forms.SignatureImageFormat.Png);
    var signatureMemoryStream = sig as MemoryStream;
    byte[] data = signatureMemoryStream.ToArray();
    

    Worked on both platforms

  • HemantSharmaHemantSharma INMember ✭✭

    I am using Device.StartTimer to check for IsBlank property every 100ms to enable/disable Save button.

    In view model constructor:
    Device.StartTimer(new TimeSpan(0, 0, 0, 0, 100), () => { CheckSignature(); return true; });

    void CheckSignature()
    {
    bool isBlank = Pad..IsBlank;
    IsSaveEnabled = !isBlank;
    }

  • HemantSharmaHemantSharma INMember ✭✭

    Is there a way to raise a ClearSignature event for the SignaturePad?

    I do not want to use the Clear text on the top-right of the signature pad. Instead I want to use my own button outside the pad.

  • Jeremy.3554Jeremy.3554 USMember
    edited October 2016

    Hi,

    When using the signature pad, in Android, the image always has a black background. Is there any workaround for this?

  • Jeremy.3554Jeremy.3554 USMember

    @Xasanrah said:

    @Andrew.4149 said:
    I thought it was transparency problem because images were showing up with black background in Crystal Reports. But then I saved image to SD card and realized they had a black background with jpegs which don't support transparency. Then I found the real problem. I didn't set the stroke and fill color. See below.

    signature.GetImage(Color.Black, Color.White)

    Thanks that helps me too

    This works for pure android coding, but when using it in xamarin forms, the image remains black, no matter what you do.
    signature.GetImageStreamAsync(SignatureImageFormat.Png)

  • Malcolm.JackMalcolm.Jack ZAMember ✭✭
    edited January 2017

    Jeremy.3554 you manage to find a XForms solution to the black image rendering?

  • Vaka.GopiNadhReddyVaka.GopiNadhReddy USMember ✭✭✭

    i done a small sample on signaturePad by using dependency in xamarin.forms, here it is......

  • VenkataSwamyVenkataSwamy INMember ✭✭✭

    Hi EveryOne,

    I did a sample on SignaturePad

    Here I used CustomRederers and DependencyService concepts.

    In this sample, We are able to get users signature in both iOS and android and we are also able to save it as an image into our local device storage.

    Please find the sample

  • DonovanJarquinDonovanJarquin USMember

    no compila en mi dice Operacion Implementar omitida proyecto SignatureSample.Droid

Sign In or Register to comment.