Skip to content

Instantly share code, notes, and snippets.

@mevsungur
Created June 9, 2021 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mevsungur/306c1c7dbe0c48616e4cc88919c41458 to your computer and use it in GitHub Desktop.
Save mevsungur/306c1c7dbe0c48616e4cc88919c41458 to your computer and use it in GitHub Desktop.
Generate Qr with zxing test
public static void main(String[] args) {
BufferedImage qrImage = null;
try {
qrImage = createQr("https://medium.com/@mevlutsungur", 150);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (WriterException e) {
e.printStackTrace();
}
final String fileFormat = "PNG";
File outputfile = new File("D:\\qr."+fileFormat);
try {
ImageIO.write(qrImage, fileFormat, outputfile);
} catch (IOException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment