qq_佑赱_03603889
2017-09-26 12:30
HashMap hints= new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
hints.put(EncodeHintType.MARGIN,2);
try {
BitMatrix bitMatrix =new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height);
Path file=new File("D:/MyEclipse/code/img.png").toPath();
MatrixToImageWriter.writeToPath(bitMatrix, format, file);
} catch (Exception e) {
e.printStackTrace();
}
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Type mismatch: cannot convert from ArrayList<?> to Collection<BlockPair>
Cannot instantiate the type ArrayList<?>
Syntax error on token "<", ? expected after this token
你这段代码是没有问题的,可以生成二维码,把你的全部代码放出来,连导入的包一起。
Java生成二维码
84502 学习 · 204 问题
相似问题