使用zxing开源框架做的扫二维码。点阵的datamatrix二维码,扫不出来,是什么原因啊?
如果是矩阵的就能很好的扫出来。是不是哪里需要设置呢?跪求大哥们的帮助。。。。!!!
private void decode(byte[] data, int width, int height) {
long start = System.currentTimeMillis();
Result rawResult = null; //扫描结果
//下面使用zxing提供的API进行解码
PlanarYUVLuminanceSource source = CameraManager.get()
.buildLuminanceSource(data, width, height);
if (source != null) {
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
try {
rawResult = multiFormatReader.decodeWithState(bitmap);
} catch (ReaderException re) {
// continue
} finally {
multiFormatReader.reset();
}
}
.........
}