c# - Xamarin SignaturePadView GetImage Android 黑色背景

标签 c# xamarin xamarin.forms xamarin.android

我总是得到黑色背景色,即使我将它设置为白色也是如此:

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

它可以在 iOS 上运行,但不能在 Android 上运行。我还能做些什么来获得白色背景吗?

编辑: 生成的 jpg 文件具有黑色背景,而不是 View !

最佳答案

您可以尝试使用签名板 View 的 GetImage 方法吗?

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

我们使用它并获得带有黑色签名的白色背景。

关于c# - Xamarin SignaturePadView GetImage Android 黑色背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46430410/

相关文章:

android - 在Windows 10和VS2015 Android模拟器上运行时,Android App崩溃

mvvm - Xamarin表格: Is Reactive Extensions (Rx) a framework that replaces MVVM pattern?

c# - MVC设计模式,服务层的目的?

c# - 我可以使用什么 JavaScript 代码在新窗口中打开,而不是我之前打开的窗口

c# - 更改 Microsoft Bot Framework 中的消息流

android - 应用程序终止时,特定 View 不会在通知点击时打开

android - Xamarin Forms WebView 地理位置问题

xamarin.forms - 如何以 xamarin 形式检测设备的大小

c# - Intellisense 不适用于带有 Xamarin 的 Visual Studio 2015 中的 .cs 文件

c# - 将字节转换为 ISO 8859-1 编码时,空字节会发生什么情况?