public final class QRCodeProduceUtils
extends java.lang.Object
desc : 二维码生成工具类
author : xuexiang
time : 2018/5/4 上午12:05
| Modifier and Type | Class and Description |
|---|---|
static class |
QRCodeProduceUtils.Builder
二维码生成构建者
|
| Modifier and Type | Field and Description |
|---|---|
static int |
QRCODE_BITMAP_MAX_SIZE
二维码最大尺寸
|
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.Bitmap |
create(java.lang.String contents,
int width,
int height,
android.graphics.Bitmap logo)
生成含图标的二维码图片
|
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean binarize) |
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean binarize,
int binarizeThreshold) |
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin) |
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean autoColor) |
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean autoColor,
boolean binarize) |
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean autoColor,
boolean binarize,
int binarizeThreshold)
Create a QR matrix and render it use given configs.
|
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
int colorDark,
int colorLight) |
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage) |
static android.graphics.Bitmap |
create(java.lang.String contents,
int size,
int margin,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin) |
static QRCodeProduceUtils.Builder |
newBuilder(java.lang.String contents)
获取二维码生成构建者
|
public static final int QRCODE_BITMAP_MAX_SIZE
public static QRCodeProduceUtils.Builder newBuilder(java.lang.String contents)
contents - public static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
int colorDark,
int colorLight)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean binarize)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean binarize,
int binarizeThreshold)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean autoColor)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean autoColor,
boolean binarize)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static android.graphics.Bitmap create(java.lang.String contents,
int size,
int margin,
float dataDotScale,
int colorDark,
int colorLight,
android.graphics.Bitmap backgroundImage,
boolean whiteMargin,
boolean autoColor,
boolean binarize,
int binarizeThreshold)
throws java.lang.IllegalArgumentException
contents - Contents to encode.size - Width as well as the height of the output QR code, includes margin.margin - Margin to add around the QR code.dataDotScale - Scale the data blocks and makes them appear smaller.colorDark - Color of blocks. Will be OVERRIDE by autoColor. (BYTE_DTA, BYTE_POS, BYTE_AGN, BYTE_TMG)colorLight - Color of empty space. Will be OVERRIDE by autoColor. (BYTE_EPT)backgroundImage - The background image to embed in the QR code. If null, no background image will be embedded.whiteMargin - If true, background image will not be drawn on the margin area.autoColor - If true, colorDark will be set to the dominant color of backgroundImage.java.lang.IllegalArgumentException - Refer to the messages below.public static android.graphics.Bitmap create(java.lang.String contents,
int width,
int height,
android.graphics.Bitmap logo)
contents - 二维码写入的数据width - 二维码的宽height - 二维码的高logo - 二维码中央的logo