简体   繁体   English

如何增加zxing的扫描面积?

[英]How to increase the scanning area of zxing?

I want to increase the scanning area size of ZXing , I have already added the ZXing libraries to my app, but I find the scanning area is too small. 我想增加ZXing的扫描区域大小,已经将ZXing库添加到我的应用程序中,但是我发现扫描区域太小。 I want to scan a large barcode, and I have encountered an error: 我想扫描大条形码,但遇到错误:

Crop rectangle does not fit within image data. 裁剪矩形不适合图像数据。

The getFramingRectInPreview() method and getFramingRect() method does not return the same size Rect . getFramingRectInPreview()方法和getFramingRect()方法不会返回相同大小的Rect

Try this one 试试这个

private static final int MIN_FRAME_WIDTH = 240;  // (your desired value here)
private static final int MIN_FRAME_HEIGHT = 240; // (your desired value here)

To CameraPreView.java calculateFrames method and resize framingRect 到CameraPreView.java的calculateFrames方法并调整framingRect的大小

framingRect.set(left,top,right,bottom);

I use this project to implement zxing scan : 我使用这个项目来实现zxing scan:
https://github.com/journeyapps/zxing-android-embedded/releases https://github.com/journeyapps/zxing-android-embedded/releases

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM