//qrcode-kotlin/qrcode.render/QRCodeGraphics/writeImage

writeImage

[android]
open fun writeImage(destination: OutputStream, format: String = "PNG", quality: Int = 100)

Writes the QRCode image in the specified format and quality into the destination OutputStream.

For app stability reasons if the specified format doesn’t exist it’ll be defaulted to PNG.

Note: Please note that JPG is supported via the JPEG value, with an E.

See also

 
Bitmap.compress
QRCodeGraphics.availableFormats

[jvm]\

@JvmOverloads

open fun writeImage(destination: OutputStream, format: String = "PNG")

Writes the QRCode image in the specified format into the destination OutputStream.

See also

 
ImageIO.write

Throws

   
UnsupportedOperationException No suitable Image Writer was found for the specified format.