List of usage examples for com.itextpdf.text.pdf.qrcode BitMatrix getWidth
public int getWidth()
From source file:com.mui.halal.experiment.MatrixToImageWriter.java
License:Apache License
/** * Renders a {@link BitMatrix} as an image, where "false" bits are rendered * as white, and "true" bits are rendered as black. *///from w w w .ja v a 2s . c o m public static BufferedImage toBufferedImage(BitMatrix matrix) { int width = matrix.getWidth(); int height = matrix.getHeight(); BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE); } } return image; }