Created
June 9, 2021 08:18
-
-
Save mevsungur/306c1c7dbe0c48616e4cc88919c41458 to your computer and use it in GitHub Desktop.
Generate Qr with zxing test
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 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