public final class QrcoderUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
BLACK |
static int |
BLUE |
static int |
GREEN |
static int |
PURPLE |
static int |
RED |
static int |
WHITE |
static int |
YELLOW |
| 构造器和说明 |
|---|
QrcoderUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
analyze(String codePath)
解析二维码
|
static void |
generate(String content,
int width,
int height,
int border,
String outPutPath)
生成二维码(默认黑白像素点)
|
static void |
generate(String content,
int width,
int height,
String outPutPath,
int frontColor,
int backColor,
int border)
生成二维码(自定义像素颜色)
|
public static final int BLACK
public static final int WHITE
public static final int RED
public static final int YELLOW
public static final int BLUE
public static final int PURPLE
public static final int GREEN
public static void generate(String content, int width, int height, int border, String outPutPath) throws Exception
content - 要生成的内容width - 宽度height - 高度border - 边框宽度(最好1-10)outPutPath - 输出全路径(包含文件本身带扩展名(图片格式,最好为png格式)) 备注:文件夹不存在则会创建Exception - 二维码生成失败public static void generate(String content, int width, int height, String outPutPath, int frontColor, int backColor, int border) throws Exception
content - 要生成的内容width - 宽度height - 高度outPutPath - 输出全路径(包含文件本身带扩展名(图片格式,最好为png格式)) 备注:文件夹不存在则会创建frontColor - 前台颜色(十六进制) 例 0x0000FFbackColor - 后台颜色(十六进制) 例 0xFFC0CBborder - 边框宽度(最好1-10)Exception - 二维码生成失败Copyright © 2018. All rights reserved.