public class QRCode
extends java.lang.Object
from(String) (e.g QRCode.from("hello"))| Modifier and Type | Method and Description |
|---|---|
java.io.File |
file()
returns a
File representation of the QR code. |
static QRCode |
from(java.lang.String text)
Create a QR code from the given text.
|
java.io.ByteArrayOutputStream |
stream()
returns a
ByteArrayOutputStream representation of the QR code |
QRCode |
to(ImageType imageType)
Overrides the imageType from its default
ImageType.PNG |
QRCode |
withSize(int width,
int height)
Overrides the size of the qr from its default 125x125
|
void |
writeTo(java.io.OutputStream stream)
writes a representation of the QR code to the supplied
OutputStream |
public static QRCode from(java.lang.String text)
to(net.glxn.qrgen.image.ImageType) e.g. QRCode.from("hello world").to(JPG) withSize(int, int) e.g. QRCode.from("hello world").to(JPG).withSize(125, 125) text - the text to encode to a new QRCode, this may fail if the text is too large. public QRCode to(ImageType imageType)
ImageType.PNGimageType - the ImageType you would like the resulting QR to bepublic QRCode withSize(int width, int height)
width - the width in pixelsheight - the height in pixelspublic java.io.File file()
File representation of the QR code. The file is set to be deleted on exit (i.e. File.deleteOnExit()).
If you want the file to live beyond the life of the jvm process, you should make a copy.public java.io.ByteArrayOutputStream stream()
ByteArrayOutputStream representation of the QR codepublic void writeTo(java.io.OutputStream stream)
OutputStreamstream - the OutputStream to write QR Code toCopyright © 2013. All Rights Reserved.