com.aspose.barcode.generation

Class BaseGenerationParameters

  • java.lang.Object
    • com.aspose.barcode.generation.BaseGenerationParameters


  • public class BaseGenerationParameters
    extends java.lang.Object

    Barcode image generation parameters.

    • Constructor Detail

      • BaseGenerationParameters

        public BaseGenerationParameters()
    • Method Detail

      • getBackColor

        public java.awt.Color getBackColor()

        Background color of the barcode image. Default value: Color.WHITE. See Color.

      • setBackColor

        public void setBackColor(java.awt.Color 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:
        java.lang.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:
        java.lang.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

        public CaptionParameters getCaptionAbove()

        Caption Above the BarCode image. See CaptionParameters.

      • getCaptionBelow

        public CaptionParameters getCaptionBelow()

        Caption Below the BarCode image. See CaptionParameters.

      • getBarcode

        public BarcodeParameters getBarcode()

        Gets the BarcodeParameters that contains all barcode properties.

      • getBorder

        public BorderParameters getBorder()

        Gets the BorderParameters that contains all configuration properties for barcode border.

      • getStateHash

        public int getStateHash()