public class BitmapCanvasProvider extends AbstractCanvasProvider
bardim| Constructor and Description |
|---|
BitmapCanvasProvider(int resolution,
int imageType,
boolean antiAlias,
int orientation)
Creates a new BitmapCanvasProvider.
|
BitmapCanvasProvider(OutputStream out,
String mime,
int resolution,
int imageType,
boolean antiAlias,
int orientation)
Creates a new BitmapCanvasProvider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deviceFillRect(double x,
double y,
double w,
double h)
Paints a filled rectangle.
|
void |
deviceText(String text,
double x1,
double x2,
double y1,
String fontName,
double fontSize,
TextAlignment textAlign)
Draws text.
|
void |
establishDimensions(BarcodeDimension dim)
Sets the dimensions of the barcode.
|
void |
finish()
Call this method to finish any pending operations after the
BarcodeGenerator has finished its work.
|
BufferedImage |
getBufferedImage()
Returns the buffered image that is used to paint the barcode on.
|
deviceCenteredText, deviceJustifiedText, getDimensions, getOrientationpublic BitmapCanvasProvider(OutputStream out, String mime, int resolution, int imageType, boolean antiAlias, int orientation)
out - OutputStream to write tomime - MIME type of the desired output format (ex. "image/png")resolution - the desired image resolution (dots per inch)imageType - the desired image type (Values: BufferedImage.TYPE_*)antiAlias - true if anti-aliasing should be enabledorientation - Orientation must be 0, 90, 180, 270, -90, -180 or -270BarcodeDimension.normalizeOrientation(int)public BitmapCanvasProvider(int resolution,
int imageType,
boolean antiAlias,
int orientation)
resolution - the desired image resolution (dots per inch)imageType - the desired image type (Values: BufferedImage.TYPE_*)antiAlias - true if anti-aliasing should be enabledorientation - Orientation must be 0, 90, 180, 270, -90, -180 or -270BarcodeDimension.normalizeOrientation(int)public void finish()
throws IOException
IOException - in case of an I/O problempublic BufferedImage getBufferedImage()
public void establishDimensions(BarcodeDimension dim)
establishDimensions in interface CanvasProviderestablishDimensions in class AbstractCanvasProviderdim - the dimensions of the barcodepublic void deviceFillRect(double x,
double y,
double w,
double h)
x - x coordinate of the upper left cornery - y coordinate of the upper left cornerw - the widthh - the heightpublic void deviceText(String text, double x1, double x2, double y1, String fontName, double fontSize, TextAlignment textAlign)
text - the text to drawx1 - the left boundaryx2 - the right boundaryy1 - the y coordinatefontName - the name of the fontfontSize - the size of the fonttextAlign - the text alignmentCopyright © 2003–2023. All rights reserved.