类 QrCodeKit
java.lang.Object
com.ijpay.core.kit.QrCodeKit
IJPay 让支付触手可及,封装了微信支付、支付宝支付、银联支付常用的支付方式以及各种常用的接口。
不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。
IJPay 交流群: 723992875、864988890
Node.js 版: https://gitee.com/javen205/TNWX
google 开源图形码工具类
- 作者:
- Javen
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static com.google.zxing.Resultstatic booleanencode(String contents, com.google.zxing.BarcodeFormat barcodeFormat, Integer margin, com.google.zxing.qrcode.decoder.ErrorCorrectionLevel errorLevel, String format, int width, int height, String saveImgFilePath) 图形码生成工具static voidencodeOutPutSteam(OutputStream outputStream, String contents, com.google.zxing.BarcodeFormat barcodeFormat, Integer margin, com.google.zxing.qrcode.decoder.ErrorCorrectionLevel errorLevel, String format, int width, int height) static voidstatic booleanwriteToFile(BufferedImage bufImg, String format, String saveImgFilePath) 将BufferedImage对象写入文件
-
构造器详细资料
-
QrCodeKit
public QrCodeKit()
-
-
方法详细资料
-
encode
public static boolean encode(String contents, com.google.zxing.BarcodeFormat barcodeFormat, Integer margin, com.google.zxing.qrcode.decoder.ErrorCorrectionLevel errorLevel, String format, int width, int height, String saveImgFilePath) 图形码生成工具- 参数:
contents- 内容barcodeFormat- BarcodeFormat对象format- 图片格式,可选[png,jpg,bmp]width- 宽height- 高margin- 边框间距pxsaveImgFilePath- 存储图片的完整位置,包含文件名- 返回:
- {boolean}
-
encodeOutPutSteam
public static void encodeOutPutSteam(OutputStream outputStream, String contents, com.google.zxing.BarcodeFormat barcodeFormat, Integer margin, com.google.zxing.qrcode.decoder.ErrorCorrectionLevel errorLevel, String format, int width, int height) throws IOException - 参数:
outputStream- 可以来自response,也可以来自文件contents- 内容barcodeFormat- BarcodeFormat对象margin- 图片格式,可选[png,jpg,bmp]errorLevel- 纠错级别 一般为:ErrorCorrectionLevel.Hformat- 图片格式,可选[png,jpg,bmp]width- 宽height- 高- 抛出:
IOException
-
decode
- 参数:
srcImgFilePath- 要解码的图片地址- 返回:
- {Result}
-
writeToFile
将BufferedImage对象写入文件- 参数:
bufImg- BufferedImage对象format- 图片格式,可选[png,jpg,bmp]saveImgFilePath- 存储图片的完整位置,包含文件名- 返回:
- {boolean}
-
main
-