同时两种条形码格式

发布于 2025-01-20 19:52:47 字数 458 浏览 3 评论 0原文

我正在使用QR码扫描库zxing。 有没有一种方法可以同时使用多个条形码格式?

例子) ONE_D_CODE_TYPES和DATA_MATRIX

ScanOptions options = new ScanOptions();
//like this
options.setDesiredBarcodeFormats(ScanOptions.ONE_D_CODE_TYPES);
options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX);

options.setPrompt("Scan a barcode");
options.setCameraId(0);  // Use a specific camera of the device
options.setBeepEnabled(false);
options.setBarcodeImageEnabled(true);

I am using a QR code scan library zxing.
Is there a way to use multiple bar code formats at the same time?

EXAMPLE)
ONE_D_CODE_TYPES And DATA_MATRIX

ScanOptions options = new ScanOptions();
//like this
options.setDesiredBarcodeFormats(ScanOptions.ONE_D_CODE_TYPES);
options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX);

options.setPrompt("Scan a barcode");
options.setCameraId(0);  // Use a specific camera of the device
options.setBeepEnabled(false);
options.setBarcodeImageEnabled(true);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空心↖ 2025-01-27 19:52:47

您可以使用|字符使用两者。尝试使用这两者:

options.setBarcodeFormats(ScanOptions.ONE_D_CODE_TYPES | ScanOptions.DATA_MATRIX);

You can use both of them using | character. Try this to use both of them:

options.setBarcodeFormats(ScanOptions.ONE_D_CODE_TYPES | ScanOptions.DATA_MATRIX);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文