类 MatrixToImageWriter


  • public class MatrixToImageWriter
    extends Object
    Writes a BitMatrix to BufferedImage, file or stream. Provided here instead of core since it depends on Java SE libraries.
    作者:
    Sean Owen
    • 方法详细资料

      • toBufferedImage

        public static 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. Uses default configuration.
        参数:
        matrix - BitMatrix to write
        返回:
        BufferedImage representation of the input
      • toBufferedImage

        public static BufferedImage toBufferedImage​(com.google.zxing.common.BitMatrix matrix,
                                                    cn.t.util.media.code.zxing.MatrixToImageConfig config)
        As toBufferedImage(BitMatrix), but allows customization of the output.
        参数:
        matrix - BitMatrix to write
        config - output configuration
        返回:
        BufferedImage representation of the input
      • writeToPath

        public static void writeToPath​(com.google.zxing.common.BitMatrix matrix,
                                       String format,
                                       Path file)
                                throws IOException
        Writes a BitMatrix to a file with default configuration.
        参数:
        matrix - BitMatrix to write
        format - image format
        file - file Path to write image to
        抛出:
        IOException - if writes to the stream fail
        另请参阅:
        toBufferedImage(BitMatrix)
      • writeToPath

        public static void writeToPath​(com.google.zxing.common.BitMatrix matrix,
                                       String format,
                                       Path file,
                                       cn.t.util.media.code.zxing.MatrixToImageConfig config)
                                throws IOException
        As writeToPath(BitMatrix, String, Path), but allows customization of the output.
        参数:
        matrix - BitMatrix to write
        format - image format
        file - file Path to write image to
        config - output configuration
        抛出:
        IOException - if writes to the file fail
      • writeToStream

        public static void writeToStream​(com.google.zxing.common.BitMatrix matrix,
                                         String format,
                                         OutputStream stream)
                                  throws IOException
        Writes a BitMatrix to a stream with default configuration.
        参数:
        matrix - BitMatrix to write
        format - image format
        stream - OutputStream to write image to
        抛出:
        IOException - if writes to the stream fail
        另请参阅:
        toBufferedImage(BitMatrix)