类 MatrixToImageWriter


  • public final class MatrixToImageWriter
    extends java.lang.Object
    Writes a BitMatrix to BufferedImage, file or stream. Provided here instead of core since it depends on Java SE libraries.
    作者:
    Sean Owen
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static java.awt.image.BufferedImage toBufferedImage​(com.google.zxing.common.BitMatrix matrix)
      Renders a BitMatrix as an image, where "false" bits are rendered as white, and "true" bits are rendered as black.
      static java.awt.image.BufferedImage toBufferedImage​(com.google.zxing.common.BitMatrix matrix, MatrixToImageConfig config)
      As toBufferedImage(BitMatrix), but allows customization of the output.
      static void writeToFile​(com.google.zxing.common.BitMatrix matrix, java.lang.String format, java.io.File file)
      Writes a BitMatrix to a file.
      static void writeToFile​(com.google.zxing.common.BitMatrix matrix, java.lang.String format, java.io.File file, MatrixToImageConfig config)
      As writeToFile(BitMatrix, String, File), but allows customization of the output.
      static void writeToStream​(com.google.zxing.common.BitMatrix matrix, java.lang.String format, java.io.OutputStream stream)
      Writes a BitMatrix to a stream.
      static void writeToStream​(com.google.zxing.common.BitMatrix matrix, java.lang.String format, java.io.OutputStream stream, MatrixToImageConfig config)
      As writeToStream(BitMatrix, String, OutputStream), but allows customization of the output.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • toBufferedImage

        public static java.awt.image.BufferedImage toBufferedImage​(com.google.zxing.common.BitMatrix matrix)
        Renders a BitMatrix as an image, where "false" bits are rendered as white, and "true" bits are rendered as black.
        参数:
        matrix - 像素点阵
        返回:
        缓存Image对象
      • toBufferedImage

        public static java.awt.image.BufferedImage toBufferedImage​(com.google.zxing.common.BitMatrix matrix,
                                                                   MatrixToImageConfig config)
        As toBufferedImage(BitMatrix), but allows customization of the output.
        参数:
        matrix - 像素点阵
        config - 像素点阵转换为缓存Image对象的配置
        返回:
        缓存Image对象
      • writeToFile

        public static void writeToFile​(com.google.zxing.common.BitMatrix matrix,
                                       java.lang.String format,
                                       java.io.File file)
                                throws java.io.IOException
        Writes a BitMatrix to a file.
        参数:
        matrix - 像素点阵
        format - 文件格式
        file - 输出文件
        抛出:
        java.io.IOException - IO异常
        java.io.IOException - IO异常
        java.io.IOException - IO异常
        另请参阅:
        toBufferedImage(BitMatrix)
      • writeToFile

        public static void writeToFile​(com.google.zxing.common.BitMatrix matrix,
                                       java.lang.String format,
                                       java.io.File file,
                                       MatrixToImageConfig config)
                                throws java.io.IOException
        As writeToFile(BitMatrix, String, File), but allows customization of the output.
        参数:
        matrix - 像素点阵
        format - 文件格式
        file - 输出文件
        config - 像素点阵转换为缓存Image对象的配置
        抛出:
        java.io.IOException - IO异常
      • writeToStream

        public static void writeToStream​(com.google.zxing.common.BitMatrix matrix,
                                         java.lang.String format,
                                         java.io.OutputStream stream)
                                  throws java.io.IOException
        Writes a BitMatrix to a stream.
        参数:
        matrix - 像素点阵
        format - 文件格式
        stream - 输出流
        抛出:
        java.io.IOException - IO异常
        另请参阅:
        toBufferedImage(BitMatrix)
      • writeToStream

        public static void writeToStream​(com.google.zxing.common.BitMatrix matrix,
                                         java.lang.String format,
                                         java.io.OutputStream stream,
                                         MatrixToImageConfig config)
                                  throws java.io.IOException
        As writeToStream(BitMatrix, String, OutputStream), but allows customization of the output.
        参数:
        matrix - 像素点阵
        format - 文件格式
        stream - 输出流
        config - 像素点阵转换为缓存Image对象的配置
        抛出:
        java.io.IOException - IO异常