亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

如果解析帶有logo的總報錯

com.google.zxing.NotFoundException
	try?{			MultiFormatReader?multiFormatReader?=?new?MultiFormatReader();						File?file?=?new?File("D:/jar/jk.jpg");						BufferedImage?image?=??ImageIO.read(file);			Map<DecodeHintType,?Object>?tmpHintsMap?=?new?EnumMap<DecodeHintType,?Object>(			????????DecodeHintType.class);			//?解碼設置編碼方式為:utf-8,			tmpHintsMap.put(DecodeHintType.CHARACTER_SET,?"utf-8");			//優化精度			tmpHintsMap.put(DecodeHintType.TRY_HARDER,?Boolean.TRUE);			//復雜模式,開啟PURE_BARCODE模式			tmpHintsMap.put(DecodeHintType.PURE_BARCODE,?Boolean.TRUE);						BinaryBitmap?binaryBitmap?=?new?BinaryBitmap(new?HybridBinarizer(new?BufferedImageLuminanceSource(image)));			Result?result?=?multiFormatReader.decode(binaryBitmap,?tmpHintsMap);			System.out.println("二維碼內容?:?"?+result.toString());			System.out.println("二維碼格式?:?"?+result.getBarcodeFormat());			System.out.println("二維碼文本?:?"?+result.getText());		}?catch?(NotFoundException?e)?{			//?TODO?Auto-generated?catch?block			e.printStackTrace();		}?catch?(IOException?e)?{			//?TODO?Auto-generated?catch?block			e.printStackTrace();		}

網上搜了 說是設置那幾個屬性? 設置了還是報錯? ?圖片是我手機拍的 然后進行截圖解析

https://img1.sycdn.imooc.com//5c2193660001c05910801104.jpg

正在回答

1 回答

圖片不清楚可能會導致解析時將logo也看成二維碼的黑條一起解析。

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

如果解析帶有logo的總報錯

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號