net.rim.device.api.barcodelib
Class BarcodeBitmap

java.lang.Object
  extended by net.rim.device.api.barcodelib.BarcodeBitmap

public final class BarcodeBitmap
extends Object

A convenience class to create a Bitmap image from a supplied ByteMatrix. See MultiFormatWriter.

Since:
BlackBerry API 6.0.0

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

createBitmap

public static Bitmap createBitmap(ByteMatrix byteMatrix,
                                  int maxBitmapSizeInPixels)
Deprecated. use BarcodeBitmap.createBitmap(ByteMatrix byteMatrix) in conjunction with MultiFormatWriter.

A convenience method to encode barcode data represented by the provided 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);
 

Parameters:
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.
Returns:
A barcode bitmap of the data.
Throws:
NullPointerException - if byteMatrix is null.
Since:
BlackBerry API 6.0.0

createBitmap

public static Bitmap createBitmap(ByteMatrix byteMatrix)
A convenience method to encode barcode data represented by the provided 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.

Parameters:
byteMatrix - The raw data to encode.
Returns:
A barcode bitmap of the data.
Throws:
NullPointerException - if byteMatrix is null.
Since:
BlackBerry API 7.0.0





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