public class QrCodeUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static String |
FORMAT
图片格式
|
private static int |
LOGO_HEIGHT
LOGO高
|
private static int |
LOGO_WIDTH
LOGO宽
|
private static int |
QRCODE_HEIGHT
高度
|
private static int |
QRCODE_WIDTH
宽度
|
private static String |
UNICODE
二维码格式
|
| 构造器和说明 |
|---|
QrCodeUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
private static void |
addLogo(BufferedImage source,
String logoPath)
添加LOGO
|
private static BufferedImage |
createImage(String content,
String logoPath) |
static String |
decode(String path)
读取二维码
|
static void |
encode(String content,
String logoPath,
OutputStream output)
生成二维码
|
static String |
save(String content,
String logoPath,
String destPath)
保存
|
private static final int QRCODE_WIDTH
private static final int QRCODE_HEIGHT
private static final int LOGO_WIDTH
private static final int LOGO_HEIGHT
private static BufferedImage createImage(String content, String logoPath) throws Exception
content - logoPath - Exceptionprivate static void addLogo(BufferedImage source, String logoPath) throws Exception
source - 二维码logoPath - LOGO路径Exceptionpublic static String save(String content, String logoPath, String destPath) throws Exception
content - logoPath - destPath - Exceptionpublic static void encode(String content, String logoPath, OutputStream output) throws Exception
content - logoPath - output - ExceptionCopyright © 2023. All rights reserved.