我正在尝试使用 ZXing 在 Xamarin 的屏幕上呈现一个简单的条形码。我已将 ZXing 包添加到我的解决方案中,并具有以下代码:
BarcodeWriterPixelData writer = new BarcodeWriterPixelData
{
Format = BarcodeFormat.CODE_39 ,
Options = new ZXing.Common.EncodingOptions{
Height = 80,
Width = 30,
Margin = 0
}
};
var data = writer.Write("18898798790");
IDBarCode.Source = ImageSource.FromStream(() => new MemoryStream(data.Pixels));
但是,我的代码运行时没有在屏幕上呈现任何内容。我一直在寻找某种我可以在没有任何成功的情况下使用的样本。