From 13b2678b0d6402cefee85bafe4da69aa72528a28 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 06 五月 2026 14:09:30 +0800
Subject: [PATCH] #real connect remove write data V3.0.2.0
---
src/main/java/com/zy/common/utils/QrCode.java | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/common/utils/QrCode.java b/src/main/java/com/zy/common/utils/QrCode.java
index 174d713..b52fbd2 100644
--- a/src/main/java/com/zy/common/utils/QrCode.java
+++ b/src/main/java/com/zy/common/utils/QrCode.java
@@ -24,11 +24,15 @@
public static BufferedImage createImg(String content) throws WriterException {
+ return createImg(content, QRCODE_SIZE);
+ }
+
+ public static BufferedImage createImg(String content, int size) throws WriterException {
ConcurrentHashMap hints = new ConcurrentHashMap();
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.CHARACTER_SET, CHARSET);
hints.put(EncodeHintType.MARGIN, 1);
- BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints);
+ BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, size, size, hints);
int width = bitMatrix.getWidth();
int height = bitMatrix.getHeight();
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
--
Gitblit v1.9.1