public class QRCodes extends CodeGenerator
如果logo图大于二维码的大小那么logo会覆盖二维码, 这时必须压缩logo 绘制logo的话 纠错等级需要提高 否则无法解析
charset, decodeHint, encodeHint, errorCorrectionLevel, font, fontColor, format, height, imgButtonMargin, imgTopMargin, suffix, width, wordsButtonMargin, wordsTopMargin, WRITER| Constructor and Description |
|---|
QRCodes() |
| Modifier and Type | Method and Description |
|---|---|
void |
encode(String content,
String words,
OutputStream out)
生成条码到流
|
protected BufferedImage |
getBufferedImage(String content)
获取 BufferedImage
|
Image |
getLogo() |
int |
getLogoHeight() |
int |
getLogoWidth() |
QRCodes |
height(int height) |
boolean |
isLogoCompress() |
QRCodes |
logo(byte[] bs) |
QRCodes |
logo(File file) |
QRCodes |
logo(Image logo) |
QRCodes |
logo(InputStream in) |
QRCodes |
logo(String file) |
QRCodes |
logoCompress()
压缩logo
|
QRCodes |
logoHeight(int logoHeight) |
QRCodes |
logoSize(int size) |
QRCodes |
logoWidth(int logoWidth) |
QRCodes |
size(int size) |
QRCodes |
size(int width,
int height) |
QRCodes |
width(int width) |
charset, decode, decode, decode, decode, decode, decodeBase64, decodeHint, decodeHint, encode, encode, encode, encodeBase64, encodeBase64, encodeHint, encodeHint, errorCorrectionLevel, font, font, font, font, fontColor, fontColor, format, getCharset, getDecodeHint, getEncodeHint, getErrorCorrectionLevel, getFont, getFontColor, getFormat, getHeight, getImgButtonMargin, getImgTopMargin, getSuffix, getWidth, getWordsButtonMargin, getWordsTopMargin, imgButtonMargin, imgMargin, imgTopMargin, insertWords, suffix, toErrorCorrectionLevel, wordsButtonMargin, wordsMargin, wordsTopMarginpublic QRCodes logoCompress()
protected BufferedImage getBufferedImage(String content)
CodeGeneratorgetBufferedImage in class CodeGeneratorcontent - 条形码内容public void encode(String content, String words, OutputStream out)
CodeGeneratorencode in class CodeGeneratorcontent - 内容words - 文字out - outputStreampublic QRCodes width(int width)
width in class CodeGeneratorpublic QRCodes height(int height)
height in class CodeGeneratorpublic QRCodes size(int width, int height)
size in class CodeGeneratorpublic QRCodes size(int size)
public QRCodes logoWidth(int logoWidth)
public QRCodes logoHeight(int logoHeight)
public QRCodes logoSize(int size)
public QRCodes logo(InputStream in)
public QRCodes logo(byte[] bs)
public int getLogoWidth()
public int getLogoHeight()
public Image getLogo()
public boolean isLogoCompress()
Copyright © 2025. All rights reserved.