Created
April 25, 2016 03:51
-
-
Save asaph/6ab76d086c711b4aa0840cfee4808c4d to your computer and use it in GitHub Desktop.
Create a QR Code PNG Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void createQRCode(String barCodeData, String filePath, int height, int width) | |
throws WriterException, IOException { | |
BitMatrix matrix = new MultiFormatWriter().encode(barCodeData, BarcodeFormat.QR_CODE, | |
width, height); | |
try (FileOutputStream out = new FileOutputStream(filePath)) { | |
MatrixToImageWriter.writeToStream(matrix, "png", out); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment