生成二维码的问题
生成二维码那步,为什么我的没有显示出捕捉异常?而是The method encode(String, BarcodeFormat, int, int) from the type MultiFormatWriter refers to the missing type BarcodeFormat,怎么解决?
生成二维码那步,为什么我的没有显示出捕捉异常?而是The method encode(String, BarcodeFormat, int, int) from the type MultiFormatWriter refers to the missing type BarcodeFormat,怎么解决?
2016-09-07
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
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();
}
举报