|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.barcodelib.BarcodeBitmap
public final class BarcodeBitmap
A convenience class to create a Bitmap
image from a supplied ByteMatrix
. See MultiFormatWriter
.
Method Summary | ||
---|---|---|
static Bitmap |
createBitmap(ByteMatrix byteMatrix)
A convenience method to encode barcode data represented by the provided ByteMatrix . |
|
static Bitmap |
createBitmap(ByteMatrix byteMatrix,
int maxBitmapSizeInPixels)
Deprecated. use BarcodeBitmap.createBitmap(ByteMatrix byteMatrix) in conjunction with MultiFormatWriter . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Bitmap createBitmap(ByteMatrix byteMatrix, int maxBitmapSizeInPixels)
BarcodeBitmap.createBitmap(ByteMatrix byteMatrix)
in conjunction with MultiFormatWriter
.
ByteMatrix
. A 4px border will be added
surrounding the returned image.
This method assumes 0 = white, 1 = black. You would use this method if you encoded your ByteMatrix in the following way:
QRCode qr = new QRCode();
Encoder.encode("abcdefg", ErrorCorrectionLevel.L, qr);
ByteMatrix barcode = qr.getMatrix();
Bitmap bitmap = createBitmap(barcode, 100);
byteMatrix
- The raw data to encode.maxBitmapSizeInPixels
- The maximum size of returned bitmap. This value is ignored if it's smaller than the minimum size required
to encode the provided ByteMatrix
(i.e. byteMatrix.getWidth() * byteMatrix.getHeight()). This value represents a maximum only and
is not guaranteed to be equivalent to the returned Bitmap
overall size.
NullPointerException
- if byteMatrix
is null
.public static Bitmap createBitmap(ByteMatrix byteMatrix)
ByteMatrix
.
This method assumes 0 = black, 255 = white. You would use this method if you encoded your ByteMatrix in the following way:
MultiFormatWriter barcodeWriter = new MultiFormatWriter();
ByteMatrix barcode = barcodeWriter.encode("abcdefg", BarcodeFormat.QR_CODE, 25, 25);
In this case you'd get a bitmap in the dimensions determined by MultiFormatWriter
.
byteMatrix
- The raw data to encode.
NullPointerException
- if byteMatrix
is null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal