类 QrCodeKit

java.lang.Object
com.ijpay.core.kit.QrCodeKit

public class QrCodeKit extends Object

IJPay 让支付触手可及,封装了微信支付、支付宝支付、银联支付常用的支付方式以及各种常用的接口。

不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。

IJPay 交流群: 723992875、864988890

Node.js 版: https://gitee.com/javen205/TNWX

google 开源图形码工具类

作者:
Javen
  • 构造器详细资料

    • 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 - 边框间距px
      saveImgFilePath - 存储图片的完整位置,包含文件名
      返回:
      {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.H
      format - 图片格式,可选[png,jpg,bmp]
      width - 宽
      height - 高
      抛出:
      IOException
    • decode

      public static com.google.zxing.Result decode(String srcImgFilePath)
      参数:
      srcImgFilePath - 要解码的图片地址
      返回:
      {Result}
    • writeToFile

      public static boolean writeToFile(BufferedImage bufImg, String format, String saveImgFilePath)
      将BufferedImage对象写入文件
      参数:
      bufImg - BufferedImage对象
      format - 图片格式,可选[png,jpg,bmp]
      saveImgFilePath - 存储图片的完整位置,包含文件名
      返回:
      {boolean}
    • main

      public static void main(String[] args)