0
I have this code that generates the Qrcode of the Zxing library:
private static byte[] getQRCodeImage(String text, int width, int height) throws WriterException, IOException {
QRCodeWriter qrCodeWriter = new QRCodeWriter();
BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height);
ByteArrayOutputStream pngOutputStream = new ByteArrayOutputStream();
MatrixToImageWriter.writeToStream(bitMatrix, "PNG", pngOutputStream);
byte[] pngData = pngOutputStream.toByteArray();
return pngData;
}
It is returning an array of bytes.
I’m making a web application.
How do I display this array as an image on the screen?
Your application is developed in Java and runs in the browser or is a web server?
– Mathias Berwig
JSF + Primefaces
– Alex Passos
There is some relevant information at this link. I will then write a reply quoting them.
– Mathias Berwig