public class QRCodeUtil
extends java.lang.Object
| Constructor and Description |
|---|
QRCodeUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.awt.image.BufferedImage |
addBottomForString(java.awt.image.BufferedImage image,
java.lang.String productName,
int width,
int height) |
static java.awt.image.BufferedImage |
addImgBottom(java.awt.image.BufferedImage image,
java.io.File bottomImg,
int width,
int height)
在二维码底部或顶部添加图片 注:可以通过修改图片的 x ,y值 来最终确定图片或文字最终摆放的位置
|
static java.awt.image.BufferedImage |
addImgTop(java.awt.image.BufferedImage image,
java.io.File topImg,
int width,
int height)
在二维码顶部或顶部添加图片 注:可以通过修改图片的 x ,y值 来最终确定图片或文字最终摆放的位置
|
static java.awt.image.BufferedImage |
addLogo_QRCode(java.awt.image.BufferedImage image,
java.io.File logoPic)
添加二维码中间的logo
|
static java.awt.image.BufferedImage |
addTopForString(java.awt.image.BufferedImage image,
java.lang.String productName,
int width,
int height) |
java.awt.image.BufferedImage |
fileToBufferedImage(com.google.zxing.common.BitMatrix bm)
构建初始化二维码
|
static java.util.Map<com.google.zxing.EncodeHintType,java.lang.Object> |
getDecodeHintType()
设置二维码的格式参数
|
static java.awt.image.BufferedImage |
getQR_CODEBufferedImage(java.lang.String content,
com.google.zxing.BarcodeFormat barcodeFormat,
int width,
int height,
java.util.Map<com.google.zxing.EncodeHintType,?> hints)
生成二维码bufferedImage图片
|
static java.lang.String |
ImageToBase64QRCode(java.awt.image.BufferedImage image) |
public static java.awt.image.BufferedImage addBottomForString(java.awt.image.BufferedImage image,
java.lang.String productName,
int width,
int height)
image - 传入的二维码图片productName - 传入位于二维码底部的文字width - 画布宽height - 画布高public static java.awt.image.BufferedImage addTopForString(java.awt.image.BufferedImage image,
java.lang.String productName,
int width,
int height)
image - 传入的二维码图片productName - 传入位于二维码顶部的文字width - 画布宽height - 画布高public static java.awt.image.BufferedImage addImgTop(java.awt.image.BufferedImage image,
java.io.File topImg,
int width,
int height)
image - 传入二维码图片topImg - 要添加的图片public static java.awt.image.BufferedImage addImgBottom(java.awt.image.BufferedImage image,
java.io.File bottomImg,
int width,
int height)
image - 传入二维码图片topImg - 要添加的图片public static java.awt.image.BufferedImage addLogo_QRCode(java.awt.image.BufferedImage image,
java.io.File logoPic)
image - 传入二维码图片logoPic - 传入logo 图片的路径public static java.lang.String ImageToBase64QRCode(java.awt.image.BufferedImage image)
throws java.io.IOException
image - 传一个二维码图片java.io.IOExceptionpublic java.awt.image.BufferedImage fileToBufferedImage(com.google.zxing.common.BitMatrix bm)
bm - public static java.awt.image.BufferedImage getQR_CODEBufferedImage(java.lang.String content,
com.google.zxing.BarcodeFormat barcodeFormat,
int width,
int height,
java.util.Map<com.google.zxing.EncodeHintType,?> hints)
content - 编码内容barcodeFormat - 编码类型width - 图片宽度height - 图片高度hints - 设置参数public static java.util.Map<com.google.zxing.EncodeHintType,java.lang.Object> getDecodeHintType()