|
@@ -755,7 +755,7 @@ public abstract class Utils {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Graphics2D g = (Graphics2D) img.getGraphics();
|
|
Graphics2D g = (Graphics2D) img.getGraphics();
|
|
- g.rotate(Math.PI / 2, length / 2, length / 2);
|
|
|
|
|
|
+ //g.rotate(Math.PI / 2, length / 2, length / 2);
|
|
g.setColor(new Color(0, 0, 0));
|
|
g.setColor(new Color(0, 0, 0));
|
|
g.setFont(new Font("宋体", Font.PLAIN, 14));
|
|
g.setFont(new Font("宋体", Font.PLAIN, 14));
|
|
// 二维码
|
|
// 二维码
|
|
@@ -776,7 +776,7 @@ public abstract class Utils {
|
|
qrcodeHandler.setQrcodeEncodeMode('B');
|
|
qrcodeHandler.setQrcodeEncodeMode('B');
|
|
// 设置二维码版本,取值范围1-40,值越大尺寸越大,可存储的信息越大
|
|
// 设置二维码版本,取值范围1-40,值越大尺寸越大,可存储的信息越大
|
|
qrcodeHandler.setQrcodeVersion(version);
|
|
qrcodeHandler.setQrcodeVersion(version);
|
|
- byte[] contentBytes = content.getBytes("gb2312");
|
|
|
|
|
|
+ byte[] contentBytes = content.getBytes("utf-8");
|
|
gs.setColor(Color.BLACK);
|
|
gs.setColor(Color.BLACK);
|
|
// 设置偏移量 不设置可能导致解析出错
|
|
// 设置偏移量 不设置可能导致解析出错
|
|
int pixoff = 2;
|
|
int pixoff = 2;
|
|
@@ -811,8 +811,8 @@ public abstract class Utils {
|
|
gs.dispose();
|
|
gs.dispose();
|
|
qrImg.flush();
|
|
qrImg.flush();
|
|
|
|
|
|
- g.drawImage(qrImg.getScaledInstance(width, length,
|
|
|
|
- Image.SCALE_DEFAULT), 6, 6, null);
|
|
|
|
|
|
+ g.drawImage(qrImg.getScaledInstance(width-5, length-5,
|
|
|
|
+ Image.SCALE_DEFAULT), 5, 5, null);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|