标签:
try {
//生成QRcode
BitMatrix matrix = new MultiFormatWriter().encode(shortChain, BarcodeFormat.QR_CODE, 500, 500);
MatrixToImageWriter.writeToPath(matrix, “PNG”, Paths.get(outFileString));
//上传七牛,返回URL
String fileName = UUID.randomUUID().toString()+".png";
File outImage = Paths.get(outFileString).toFile();
qrCode.setImageUrl(FileUploadUtils.saveFileInQiNiu(fileName, outImage).getUrl());
outImage.delete();
} catch (Exception e) {
e.printStackTrace();
标签:
原文地址:http://www.cnblogs.com/asfeixue/p/4452777.html