问 google ZXing 生成二维码
//二维码内容
String text = "你好";
int width = 100; //宽
int height = 100; //高
String format = "png"; //图片格式
Hashtable hints= new Hashtable();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
BitMatrix bitMatrix = new MultiFormatWriter().encode(text, BarcodeFormat.QR_CODE, width, height,hints);
//输出二维码目录
File outputFile = new File("F:/new.png");
MatrixToImageWriter.writeToFile(bitMatrix, format, outputFile);