This commit is contained in:
cun-nan 2024-07-04 08:41:20 +08:00
parent 0f971b096e
commit 926d47c97f
4 changed files with 7 additions and 6 deletions

View File

@ -22,6 +22,7 @@ import javax.swing.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.awt.image.RenderedImage;
import java.io.*;
@ -67,11 +68,11 @@ public class QrCodeUtils {
Graphics2D g = bufImg.createGraphics();
g.drawImage(srcImg, 0, 0, srcImgWidth, srcImgHeight, null);
//使用工具类生成二维码
Image image = createQrCode(logoStream, url, 360, 360);
// Image image = createQrCode(logoStream, url, 260, 260);
// Image image = createQrCode(logoStream, url, 360, 360);
Image image = createQrCode(logoStream, url, 270, 270);
//将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置
g.drawImage(image, (bufImg.getWidth()-360)/2, 320, null);
// g.drawImage(image, (bufImg.getWidth()-260)/2, 153, null);
// g.drawImage(image, (bufImg.getWidth()-360)/2, 320, null);
g.drawImage(image, (bufImg.getWidth()-270)/2, 153, null);
// 设置字体样式字体大小
// g.setFont(new Font("TimesRoman", Font.BOLD, 20));
g.setFont(chineseFont());

View File

@ -60,9 +60,9 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> impleme
//在图片上生成二维码
String backgroundImage = "";
if (type.equals("0")){
backgroundImage = "static/qrCodeImg/laigeyouhui_bg.jpg";
backgroundImage = "static/qrCodeImg/mendian_bg1.png";
}else {
backgroundImage = "static/qrCodeImg/laigeyouhui_bg1.png";
backgroundImage = "static/qrCodeImg/mendian_bg2.png";
}
String logoImage = "static/qrCodeImg/logo.png";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 77 KiB