How to implement responsive xamarin.controls.signaturepad.forms ?

BhautikBhautik Member ✭✭✭

In landscape mode signature is getting crop.so is there any way to implement signature pad in such a way that size of a signature does not crop in portrait or landscape?

Answers

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    @Bhautik

    If the user draws outside the bounds of the signature pad control, the image will be cropped. I don'[t think there is anything you can do about that other than make the control as big as you need it to give the user ample space to sign.

    If I am misunderstanding what you mean, do let me know.

  • DannyNDannyN USUniversity ✭✭

    Did you figure this out? We are trying to do the same thing. If the user signs in landscape and then the device is turned to portrait, it will crop everything outside of the control. If you figured out a solution, let us know. Thanks!

  • BhautikBhautik Member ✭✭✭
    edited February 13

    @DannyN said:
    Did you figure this out? We are trying to do the same thing. If the user signs in landscape and then the device is turned to portrait, it will crop everything outside of the control. If you figured out a solution, let us know. Thanks!

    Right now I have took two different signature pad for landscape and portrait.If i switch from portrait to landscape I just assign portrait signature paid points to landscape signature pad and I do same for reverse scenario.Below is my code.

    public void LandScapeSignaturePad(object sender, EventArgs e)
            {
                var originalPoints = JsonConvert.SerializeObject(portraitSigneturePadView.Points.ToArray());
                Xamarin.Forms.Point[] points = JsonConvert.DeserializeObject<Xamarin.Forms.Point[]>(originalPoints);
                LargePadView.Points = points;
                largeSignaturePad.Padding = 0;
                largeSignaturePad.IsVisible = true;
                LargePadView.HeightRequest = this.Height;
                LargePadView.WidthRequest = this.Width;
            }
    
            public void PortraitSignaturePad(object sender, EventArgs e)
            {
                var originalPoints = JsonConvert.SerializeObject(LargePadView.Points.ToArray());
                Xamarin.Forms.Point[] points = JsonConvert.DeserializeObject<Xamarin.Forms.Point[]>(originalPoints);
                portraitSigneturePadView.Points = points;
                largeSignaturePad.IsVisible = false;
            }
    
Sign In or Register to comment.