public class QRCodeColored extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BLACK |
static String |
GIF |
static String |
JPG |
static String |
PNG |
static int |
WHITE |
| Constructor and Description |
|---|
QRCodeColored() |
| Modifier and Type | Method and Description |
|---|---|
static QRCodeColored |
from(String text) |
int |
getHeight() |
HashMap<com.google.zxing.EncodeHintType,Object> |
getHints() |
String |
getImageType() |
int |
getOffColor() |
int |
getOnColor() |
String |
getText() |
int |
getWidth() |
void |
setHeight(int height) |
void |
setImageType(String imageType) |
void |
setOffColor(int offColor) |
void |
setOnColor(int onColor) |
void |
setText(String text) |
void |
setWidth(int width) |
ByteArrayOutputStream |
stream()
returns a
ByteArrayOutputStream representation of the QR code |
QRCodeColored |
to(String imageType)
Overrides the imageType from its default
PNG |
QRCodeColored |
withColor(int onColor,
int offColor) |
QRCodeColored |
withErrorCorrection(com.google.zxing.qrcode.decoder.ErrorCorrectionLevel level)
Overrides the default error correction by supplying a
EncodeHintType.ERROR_CORRECTION
hint to QRCodeWriter.encode(java.lang.String, com.google.zxing.BarcodeFormat, int, int) |
QRCodeColored |
withHint(com.google.zxing.EncodeHintType hintType,
Object value)
Sets hint to
QRCodeWriter.encode(java.lang.String, com.google.zxing.BarcodeFormat, int, int) |
QRCodeColored |
withSize(int width,
int height)
Overrides the size of the qr from its default 125x125
|
void |
writeTo(OutputStream stream)
writes a representation of the QR code to the supplied
OutputStream |
public static final int BLACK
public static final int WHITE
public static final String JPG
public static final String GIF
public static final String PNG
public String getImageType()
public void setImageType(String imageType)
public static QRCodeColored from(String text)
public QRCodeColored withErrorCorrection(com.google.zxing.qrcode.decoder.ErrorCorrectionLevel level)
EncodeHintType.ERROR_CORRECTION
hint to QRCodeWriter.encode(java.lang.String, com.google.zxing.BarcodeFormat, int, int)public QRCodeColored withHint(com.google.zxing.EncodeHintType hintType, Object value)
QRCodeWriter.encode(java.lang.String, com.google.zxing.BarcodeFormat, int, int)public QRCodeColored withSize(int width, int height)
width - the width in pixelsheight - the height in pixelspublic QRCodeColored withColor(int onColor, int offColor)
public ByteArrayOutputStream stream()
ByteArrayOutputStream representation of the QR codepublic void writeTo(OutputStream stream)
OutputStreamstream - the OutputStream to write QR Code topublic QRCodeColored to(String imageType)
PNGimageType - the you would like the resulting QR to bepublic int getWidth()
public void setWidth(int width)
public int getHeight()
public void setHeight(int height)
public String getText()
public void setText(String text)
public int getOnColor()
public void setOnColor(int onColor)
public int getOffColor()
public void setOffColor(int offColor)
Copyright © 2014–2015 Karumien s.r.o.. All rights reserved.