public static void main(String[] args)throws WriterException, IOException {
QRCodeWriter qrCodeWriter = new QRCodeWriter();
Map x=new Hashtable();
x.put(EncodeHintType.CHARACTER_SET, "utf-8");//设置字符集
BitMatrix bitMatrix = qrCodeWriter.encode("跳转url的http://192.168.0.111:8089/gongge#/", BarcodeFormat.QR_CODE, 70, 71,x);
File path=new File("C:/Users/dell/Desktop/1new.PNG");//设置文件路径
MatrixToImageWriter.writeToFile(bitMatrix, "PNG", path);//使用此方法保存至文件中
}
java生成二维码
最新推荐文章于 2024-05-23 18:14:06 发布
关键词由CSDN通过智能技术生成