【发布时间】:2016-06-25 10:32:06
【问题描述】:
我想同时显示 QR 码和 Codabar 码。
这是我的代码。
var qrcodeWriter = new ZXing.Mobile.BarcodeWriter {
Format = ZXing.BarcodeFormat.QR_CODE,
Options = new ZXing.Common.EncodingOptions {
Width = 400,
Height = 400,
Margin = 1
}
};
var qrcode = qrcodeWriter.Write (order.order_number);
imageQR.Image = qrcode;
var barcodeWriter = new ZXing.Mobile.BarcodeWriter {
Format = ZXing.BarcodeFormat.CODABAR,
Options = new ZXing.Common.EncodingOptions {
Width = 400,
Height = 80,
Margin = 1
}
};
var barcode = barcodeWriter.Write (order.order_number);
imageBar.Image = barcode;
QR 码成功但 codabar 在barcodeWriter.write 函数中失败。
请帮帮我。
错误代码:
ex {System.ArgumentException: Cannot encode : 'T' at ZXing.OneD.CodaBarWriter.encode (System.String co...} System.ArgumentException
调用堆栈:
MasterBee.HistoryDetailViewController.ViewDidLoad() in /Volumes/Untitled/MsterBee_TEMP/MasterBee/ViewControllers/History/HistoryDetailViewController.cs:69
UIKit.UIApplication.UIApplicationMain() 在 UIKit.UIApplication.Main(string[] args, System.IntPtr principal, System.IntPtr delegate) 在 /Users/builder/data/lanes/3339/39ebb778/source/maccore/src/UIKit/UIApplication.cs:79
UIKit.UIApplication.Main(string[] args, string principalClassName, string delegateClassName) in /Users/builder/data/lanes/3339/39ebb778/source/maccore/src/UIKit/UIApplication.cs:63
MasterBee.Application.Main(string[] args) in /Volumes/Untitled/MsterBee_TEMP/MasterBee/Main.cs:15
【问题讨论】:
-
您的错误/异常是什么?
-
ex {System.ArgumentException:无法在 ZXing.OneD.CodaBarWriter.encode 编码:'T'(System.String co…} System.ArgumentException
-
请通过编辑问题添加异常和堆栈跟踪。
-
我添加了错误代码
-
堆栈跟踪在哪里?
标签: ios xamarin.ios barcode zxing