1、编码
/*参数说明
String str : 需要编码字符
int size : 二维码大小,像素单位
int onColor : 前景色,整数颜色 如 0xFF000000
int offColor : 背景色,整数颜色 如 0xFFFFFFFF
String savepath : 二维保存地址
String filename : 二维码保存名称
String logopath : 二维码需要加logo的路径
String text : 二维码下方的文本内容
boolean round : 二维码是否为圆角
boolean transparent : 二维码是否为透明背景
*/
/*---保存为文件---*/
String qrcode(String str,int size,int onColor,int
offColor,String savepath,String filename)
String
qrcode(String str,int size,int onColor,int offColor,String savepath,String
filename,String logopath,String text)
String qrcode(String
str,int size,int onColor,int offColor,String savepath,String filename,String
logopath,String text,boolean round,boolean transparent)
String qrcode(String str,int size,String savepath,String filename)
String qrcode(String str,int size,String savepath,String filename,String
logopath,String text)
String qrcode(String str,int
size,String savepath,String filename,String logopath,String text,boolean
round,boolean transparent)
String qrcodelogo(String
str,int size,String savepath,String filename,String logopath)
String qrcodelogo(String str,int size,String savepath,String filename,String
logopath,String text)
String qrcodelogo(String str,int
size,String savepath,String filename,String logopath,String text,boolean
round,boolean transparent)
String qrcodetext(String str,int size,String savepath,String filename,String text)
/*---输出base64字符串---*/
String qrcode2base64(String str,int size)
String
qrcode2base64(String str,int size,int onColor,int offColor)
String qrcodelogo2base64(String str,int size,int
onColor,int offColor,String logopath)
String
qrcodelogo2base64(String str,int size,int onColor,int offColor,String
logopath,String text)
String qrcodelogo2base64(String str,int
size,String logopath)
String qrcodetext2base64(String
str,int size,int onColor,int offColor,String text)
String
qrcodetext2base64(String str,int size,String logopath,String text)
String qrcodetext2base64(String str,int size,String
text)
/*---输出图像数据---*/
BufferedImage qrcode(String str,int size)
BufferedImage
qrcode(String str,int size,int onColor,int offColor)
BufferedImage qrcodelogo(String str,int
size,int onColor,int offColor,String logopath)
BufferedImage
qrcodelogo(String str,int size,int onColor,int offColor,String logopath,String
text)
BufferedImage qrcodelogo(String str,int size,int
onColor,int offColor,String logopath,String text,boolean round,boolean
transparent)
BufferedImage qrcodelogo(String str,int
size,String logopath)
BufferedImage qrcodelogo(String str,int
size,String logopath,String text)
BufferedImage qrcodetext(String str,int
size,int onColor,int offColor,String
text) //获取指定尺寸、前景色、背景色及带文本的二维码图像数据
BufferedImage qrcodetext(String
str,int size,String text)
/*---输出二进制数据---*/
byte[]
qrcode2bytes(String str,int size) //输出指定大小的二维码二进制数据
byte[]
qrcode2bytes(String str,int size,int onColor,int offColor)
byte[] qrcodelogo2bytes(String str,int size,int onColor,int offColor,String
logopath)
byte[] qrcodelogo2bytes(String str,int size,int
onColor,int offColor,String logopath,String text)
byte[]
qrcodelogo2bytes(String str,int size,String logopath)
byte[]
qrcodelogo2bytes(String str,int size,String logopath,String text)
byte[] qrcodetext2bytes(String str,int size,int onColor,int
offColor,String text)
byte[] qrcodetext2bytes(String str,int
size,String text)
/*---直接输出到浏览端---*/
void qrcodeOut(String str,int
size)//浏览器输出指定大小的二维码,下同
void qrcodeOut(String str,int size,String
logo)
void qrcodeOut(String str,int size,String logo,String text)
void qrcodeOut(String str,int size,int onColor,int offColor)
void
qrcodeOut(String str,int size,int onColor,int offColor,String logo)
void
qrcodeOut(String str,int size,int onColor,int offColor,String logo,String
text)
void qrcodeOut(String str,int size,int onColor,int offColor,String
logo,String text,boolean round,boolean transparent)
void qrcodeTextOut(String str,int size,String
text)//浏览器输出指定尺寸带文本的二维码
void qrcodeTextOut(String str,int size,int
onColor,int offColor,String text)
2、解码
String qrDecode(String filename)