简体   繁体   English

Xamarin SignaturePadView GetImage Android黑色背景

[英]Xamarin SignaturePadView GetImage Android Black Background

I always get a black background color, even when I set it to white: 我总是得到黑色背景颜色,即使我将其设置为白色:

  SignaturePadView sigView = new SignaturePadView(Forms.Context);
  sigView.StrokeColor = Color.Black;
  sigView.BackgroundColor = Color.White;
  var stream = await sigView.GetImageStreamAsync(SignatureImageFormat.Jpeg);

It is working on iOS, but Android doesn't. 它适用于iOS,但Android不支持。 Is there something else I can do to get a white background? 我还能做些什么来获得白色背景吗?

EDIT: The resulting jpg-file has a black background, not the view! 编辑:生成的jpg文件有黑色背景,而不是视图!

Can you try using GetImage method of the Signature pad View ? 你能尝试使用Signature pad View的GetImage方法吗?

sigView.GetImage(Android.Graphics.Color.Black, Android.Graphics.Color.White, false); sigView.GetImage(Android.Graphics.Color.Black,Android.Graphics.Color.White,false);

We uses this and gets in white background with black signature. 我们使用这个并获得带有黑色签名的白色背景。

Saving transparent layer in jpg results in black background. 在jpg中保存透明图层会导致黑色背景。 Save in png instead to keep the alpha layer. 保存在png中以保留alpha图层。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM