0

我在我的 PCL 项目中使用了 Xamarin Control SignaturePad 表单。代码如下:

public class DigitalSignature : ContentPage
 {
        SignaturePadView sign = new SignaturePadView();

        public DigitalSignature()
        {
            Button btnOk = new Button
            {
                Text = "Ok",
                BackgroundColor = Color.FromHex("#ff6600"),
                HorizontalOptions = LayoutOptions.End,
                WidthRequest = 100,
                HeightRequest = 35,
                FontSize = 15
            };

            btnOk.Clicked += btnOk_Clicked;

            sign = new SignaturePadView()
            {
                SignatureLineColor = Color.Red,
                StrokeColor = Color.Black,
                StrokeWidth = 10f,
                HeightRequest = 150,
                BackgroundColor = Color.White,
                ClearText = "Clear Me"
            };
            sign.CaptionText = "pls sign here";


            Content = new StackLayout
            {
                Children = {
                    sign,
                    btnOk
                }
            };

        }

        private void btnOk_Clicked(object sender, EventArgs e)
        {

        }
    }

如何将签名作为图像获取并存储在数据库(MSSQL)中?在 signaturepadview 中没有 getImage() 函数。任何人都知道我该怎么做?

谢谢

4

1 回答 1

0

@Derick 你必须使用下面的代码。

       Var mySignPad = new SignaturePadView()
        {
            StrokeWidth = 3,
            StrokeColor = Color.Black,
            BackgroundColor = Color.White,
            HeightRequest = 300,
            WidthRequest = 300
        };
   var getSignedImage = mySignPad.GetImageStreamAsync(SignatureImageFormat.Jpg);
于 2017-04-16T22:48:03.443 回答