Java 如何修复不正确的条形码扫描?
我使用“me.dm7.barcodescanner:zxing:1.9”从条形码中获取代码,程序运行良好,但存在一个问题。即使条形码不在矩形中,程序也能工作,此时程序给出的代码与条形码完全不同。当条形码显示在矩形上时,如何使程序工作Java 如何修复不正确的条形码扫描?,java,android,android-studio,barcode,zxing,Java,Android,Android Studio,Barcode,Zxing,我使用“me.dm7.barcodescanner:zxing:1.9”从条形码中获取代码,程序运行良好,但存在一个问题。即使条形码不在矩形中,程序也能工作,此时程序给出的代码与条形码完全不同。当条形码显示在矩形上时,如何使程序工作 ViewGroup contentFrame = (ViewGroup) findViewById(R.id.ScanView); mScannerView = new ZBarScannerView(this); contentFrame.addView(mSc
ViewGroup contentFrame = (ViewGroup) findViewById(R.id.ScanView);
mScannerView = new ZBarScannerView(this);
contentFrame.addView(mScannerView);
barcodeFormatEAN13 = BarcodeFormat.EAN13;
listaZaFormat.add(barcodeFormatEAN13);
mScannerView.setFormats(listaZaFormat);
askForPermission(Manifest.permission.CAMERA, CAMERA);
我建议将取景器设置为与摄影机视图相同的大小,因为整个摄影机视图将查找条形码。在我使用zscanner的软件时,它有时会检测到丢失的条形码。如果将帧缩小,则它可能更易于控制