|
barcode4j 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.krysalis.barcode4j.output.bitmap.BitmapBuilder
public class BitmapBuilder
Helper class for bitmap generation.
Constructor Summary | |
---|---|
protected |
BitmapBuilder()
Utility class: Constructor prevents instantiating when subclassed. |
Method Summary | |
---|---|
static java.awt.image.BufferedImage |
getImage(BarcodeGenerator bargen,
java.lang.String msg,
int resolution)
Generates a barcode as bitmap image. |
static void |
outputBarcodeImage(BarcodeGenerator bargen,
java.lang.String msg,
java.io.OutputStream out,
java.lang.String mime,
int resolution)
Generates a barcode as bitmap image file. |
static java.awt.Graphics2D |
prepareGraphics2D(java.awt.image.BufferedImage image,
BarcodeDimension dim,
int orientation,
boolean antiAlias)
Prepares a Graphics2D object for painting on a given BufferedImage. |
static java.awt.image.BufferedImage |
prepareImage(BarcodeDimension dim,
int resolution,
int imageType)
Prepares a BufferedImage to paint to. |
static java.awt.image.BufferedImage |
prepareImage(BarcodeDimension dim,
int orientation,
int resolution,
int imageType)
Prepares a BufferedImage to paint to. |
static void |
saveImage(java.awt.image.BufferedImage image,
java.io.OutputStream out,
java.lang.String mime,
int resolution)
Convenience method for save a bitmap to a file/OutputStream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected BitmapBuilder()
Method Detail |
---|
public static java.awt.image.BufferedImage prepareImage(BarcodeDimension dim, int resolution, int imageType)
dim
- the barcode dimensionsresolution
- the desired image resolution (dots per inch)imageType
- the desired image type (Values: BufferedImage.TYPE_*)
public static java.awt.image.BufferedImage prepareImage(BarcodeDimension dim, int orientation, int resolution, int imageType)
dim
- the barcode dimensionsorientation
- the barcode orientation (0, 90, 180, 270)resolution
- the desired image resolution (dots per inch)imageType
- the desired image type (Values: BufferedImage.TYPE_*)
public static java.awt.Graphics2D prepareGraphics2D(java.awt.image.BufferedImage image, BarcodeDimension dim, int orientation, boolean antiAlias)
image
- the BufferedImage instancedim
- the barcode dimensionsorientation
- the barcode orientation (0, 90, 180, 270)antiAlias
- true enables anti-aliasing
public static java.awt.image.BufferedImage getImage(BarcodeGenerator bargen, java.lang.String msg, int resolution)
bargen
- the BarcodeGenerator to usemsg
- the message to encoderesolution
- the desired image resolution (dots per inch)
public static void saveImage(java.awt.image.BufferedImage image, java.io.OutputStream out, java.lang.String mime, int resolution) throws java.io.IOException
image
- image to saveout
- OutputStream to write tomime
- MIME type of the desired output format (ex. "image/png")resolution
- the image resolution (dots per inch)
java.io.IOException
- In case of an I/O problemBitmapEncoderRegistry
public static void outputBarcodeImage(BarcodeGenerator bargen, java.lang.String msg, java.io.OutputStream out, java.lang.String mime, int resolution) throws java.io.IOException
bargen
- the BarcodeGenerator to usemsg
- the message to encodeout
- the OutputStream to write tomime
- MIME type of the desired output format (ex. "image/png")resolution
- the desired image resolution (dots per inch)
java.io.IOException
- In case of an I/O problem
|
barcode4j 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |