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

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

生成二維碼的問題

生成二維碼那步,為什么我的沒有顯示出捕捉異常?而是The method encode(String, BarcodeFormat, int, int) from the type MultiFormatWriter refers to the missing type BarcodeFormat,怎么解決?

正在回答

4 回答

這個問題是 jar包沒處理好造成的編譯報錯信息

導入zxing的源碼,源碼有一些編譯錯誤信息要處理好,然后再導出jar包,? 這個jar包才算是可以使用的。

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

都沒人解答錯誤?

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

try{
???BitMatrix bitT=new MultiFormatWriter().encode(content,BarcodeFormat.QR_CODE,width,height,hints);
???Path file=new File("D:/jaja/img.png").toPath();
???MatrixToImageWriter.writeToPath(bitT,format,file);
??}catch(Exception e){
???e.printStackTrace();
??}
?}

出現錯誤說The method encode(String, BarcodeFormat, int, int, Map<EncodeHintType,?>) from the type MultiFormatWriter refers to the missing type BitMatrix
?The method writeToPath(BitMatrix, String, Path) from the type MatrixToImageWriter refers to the missing type BitMatrix

啥情況0.0

?

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

名字要牛逼

LZ,你解決了嗎,我也遇到了
2017-06-01 回復 有任何疑惑可以回復我~

try {

BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height,hints);

Path file ?= new File("E:\\img.png").toPath();

FileOutputStream out=new FileOutputStream("E:\\img.png");

MatrixToImageWriter.writeToStream(bitMatrix, format, out);

} catch (Exception e) {

e.printStackTrace();

}


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

qq_BullshitGame_0 提問者

hints.put(EncodeHintType.MARGIN, 2); 這句 顯示錯誤說 put重名了? 前面還有2行代碼 是hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); 怎么回事?
2016-09-08 回復 有任何疑惑可以回復我~
#2

qq_BullshitGame_0 提問者

寫中文的時候 掃描是亂碼 版本問題嗎?
2016-09-08 回復 有任何疑惑可以回復我~
#3

qq_習慣就好_11 回復 qq_BullshitGame_0 提問者

點擊編寫的類,右鍵->properties->other改為utf-8試試
2016-09-09 回復 有任何疑惑可以回復我~
#4

qq_BullshitGame_0 提問者 回復 qq_習慣就好_11

!!! 注析 變亂碼了.!
2016-09-10 回復 有任何疑惑可以回復我~
查看1條回復

舉報

0/150
提交
取消
Java生成二維碼
  • 參與學習       84574    人
  • 解答問題       279    個

二維碼無處不在,自己動手用Java生成二維碼,三種生成方式任你選

進入課程

生成二維碼的問題

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

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

幫助反饋 APP下載

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

公眾號

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