public class QrCodeRender extends Render
Constructor and Description |
---|
QrCodeRender(String content,
int width,
int height)
构造方法,经测试不指定纠错参数时,默认使用的是 'L' 最低级别纠错参数
|
QrCodeRender(String content,
int width,
int height,
char errorCorrectionLevel)
带有纠错级别参数的构造方法,纠错能力从高到低共有四个级别:'H'、'Q'、'M'、'L'
|
QrCodeRender(String content,
int width,
int height,
com.google.zxing.qrcode.decoder.ErrorCorrectionLevel errorCorrectionLevel)
带有纠错级别参数的构造方法,生成带有 logo 的二维码采用纠错原理
使用 ErrorCorrectionLevel.H 参数提升纠错能力
ErrorCorrectionLevel 是枚举类型,纠错能力从高到低共有四个级别:
H = ~30% correction
Q = ~25% correction
M = ~15% correction
L = ~7%
使用的时候直接这样:ErrorCorrectionLevel.H
|
Modifier and Type | Method and Description |
---|---|
void |
render()
Render to client
|
getDevMode, getEncoding, getView, setContext, setContext, setView
public QrCodeRender(String content, int width, int height)
content
- 二维码携带内容width
- 二维码宽度height
- 二维码高度public QrCodeRender(String content, int width, int height, com.google.zxing.qrcode.decoder.ErrorCorrectionLevel errorCorrectionLevel)
public QrCodeRender(String content, int width, int height, char errorCorrectionLevel)
Copyright © 2018. All rights reserved.