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 convienence 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, int maxBitmapSizeInPixels)
          A convience method to encode barcode data represented by the provided byteMatrix.
 
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)
A convience 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:
matrix - raw data to encode
maxBitmapSizeInPixels - max 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 guarenteed to be equivalent to the returned Bitmap's overall size.
Returns:
A barcode bitmap of the data
Throws:
NullPointerException - if byteMatrix is null.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.