C#在使用zxing的时候总是引发类型为“com.google.zxing.ReaderException”的异常。
求解
调用代码如下:
MultiFormatReader reader = new MultiFormatReader();
Bitmap bitmap = new Bitmap("test.png");
RGBLuminanceSource source = new RGBLuminanceSource(bitmap,bitmap.Width,bitmap.Height);
HybridBinarizer binarizer = new HybridBinarizer(source);
BinaryBitmap bbitmap = new BinaryBitmap(binarizer);
//Hashtable hints = new Hashtable();
//hints.Add(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT, "GBK");
Result result = new MultiFormatReader().decode(bbitmap);
tb_result.Text = result.Text;
到这一步 Result result = new MultiFormatReader().decode(bbitmap);无论用什么解码方式都抛出异常,我用的二维码在QRcode可以解出来。
另外还要问下
如果使用摄像头扫描的话,拍下的照片需要再处理么,还是直接输入zxing就可以解码。求高手指教