Class BaseGenerationParameters
Barcode image generation parameters.
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies the different types of automatic sizing modes.intBackground color of the barcode image.Gets theBarcodeParametersthat contains all barcode properties.Gets theBorderParametersthat contains all configuration properties for barcode border.Caption Above the BarCode image.Caption Below the BarCode image.getImage()Image parameters.BarCode image height whenAutoSizeModeproperty is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.BarCode image width whenAutoSizeModeproperty is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.floatGets the resolution of the BarCode image.floatBarCode image rotation angle, measured in degree, e.g.booleanGets a value indicating whether is used anti-aliasing mode to render imagevoidsetAutoSizeMode(AutoSizeMode value) Specifies the different types of automatic sizing modes.voidsetBackColor(int value) Background color of the barcode image.voidsetImageHeight(Unit value) BarCode image height whenAutoSizeModeproperty is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.voidsetImageWidth(Unit value) BarCode image width whenAutoSizeModeproperty is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.voidsetResolution(float value) Sets the resolution of the BarCode image.voidsetRotationAngle(float value) BarCode image rotation angle, measured in degree, e.g.voidsetUseAntiAlias(boolean value) Sets a value indicating whether is used anti-aliasing mode to render image
-
Method Details
-
getUseAntiAlias
public boolean getUseAntiAlias()Gets a value indicating whether is used anti-aliasing mode to render image
-
setUseAntiAlias
public void setUseAntiAlias(boolean value) Sets a value indicating whether is used anti-aliasing mode to render image
-
getBackColor
public int getBackColor()Background color of the barcode image. Default value: Color.White. See
Color. -
setBackColor
public void setBackColor(int value) Background color of the barcode image. Default value: Color.White. See
Color. -
getResolution
public float getResolution()Gets the resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi.
- Throws:
IllegalArgumentException-<p>The <b>Resolution</b> parameter value is less than or equal to 0.</p>
-
setResolution
public void setResolution(float value) Sets the resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi.
- Throws:
IllegalArgumentException-<p>The <b>Resolution</b> parameter value is less than or equal to 0.</p>
-
getRotationAngle
public float getRotationAngle()BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0.
This sample shows how to create and save a BarCode image.
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX); generator.getParameters().setRotationAngle(7f); generator.save("test.png"); -
setRotationAngle
public void setRotationAngle(float value) BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0.
This sample shows how to create and save a BarCode image.
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX); generator.getParameters().setRotationAngle(7f); generator.save("test.png"); -
getCaptionAbove
Caption Above the BarCode image. See
CaptionParameters. -
getCaptionBelow
Caption Below the BarCode image. See
CaptionParameters. -
getImage
Image parameters. See. - Returns:
-
getAutoSizeMode
Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.NONE.
-
setAutoSizeMode
Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.NONE.
-
getImageHeight
BarCode image height when
AutoSizeModeproperty is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION. -
setImageHeight
BarCode image height when
AutoSizeModeproperty is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION. -
getImageWidth
BarCode image width when
AutoSizeModeproperty is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION. -
setImageWidth
BarCode image width when
AutoSizeModeproperty is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION. -
getBarcode
Gets the
BarcodeParametersthat contains all barcode properties. -
getBorder
Gets the
BorderParametersthat contains all configuration properties for barcode border.
-