com.aspose.barcode.generation

Class Unit

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


  • public final class Unit
    extends java.lang.Object

    Specifies the size value in different units (Pixel, Inches, etc.).


      This sample shows how to create and save a BarCode image.
      
              BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.CODE_128);
              generator.getBarHeight().setMillimeters(10);
        generator.save("test.png");
            

    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj)
      Determines whether this instance and a specified object, which must also be a Unit object, have the same value.
      float getDocument()
      Gets size value in document units.
      float getInches()
      Gets size value in inches.
      float getMillimeters()
      Gets size value in millimeters.
      float getPixels()
      Gets size value in pixels.
      float getPoint()
      Gets size value in point.
      int getPx()
      Deprecated. 
      int hashCode()
      Returns the hash code for this object.
      void setDocument(float value)
      Sets size value in document units.
      void setInches(float value)
      Sets size value in inches.
      void setMillimeters(float value)
      Sets size value in millimeters.
      void setPixels(float value)
      Sets size value in pixels.
      void setPoint(float value)
      Sets size value in point.
      java.lang.String toString()
      Returns a human-readable string representation of this Unit.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getPixels

        public float getPixels()

        Gets size value in pixels.

      • setPixels

        public void setPixels(float value)

        Sets size value in pixels.

      • getPx

        @Deprecated
        public int getPx()
        Deprecated. 
      • getInches

        public float getInches()

        Gets size value in inches.

      • setInches

        public void setInches(float value)

        Sets size value in inches.

      • getMillimeters

        public float getMillimeters()

        Gets size value in millimeters.

      • setMillimeters

        public void setMillimeters(float value)

        Sets size value in millimeters.

      • getPoint

        public float getPoint()

        Gets size value in point.

      • setPoint

        public void setPoint(float value)

        Sets size value in point.

      • getDocument

        public float getDocument()

        Gets size value in document units.

      • setDocument

        public void setDocument(float value)

        Sets size value in document units.

      • toString

        public java.lang.String toString()

        Returns a human-readable string representation of this Unit.

        Overrides:
        toString in class java.lang.Object
        Returns:
        A string that represents this Unit.
      • equals

        public boolean equals(java.lang.Object obj)

        Determines whether this instance and a specified object, which must also be a Unit object, have the same value.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The Unit to compare to this instance.
        Returns:
        true if obj is a Unit and its value is the same as this instance; otherwise, false. If obj is null, the method returns false.
      • hashCode

        public int hashCode()

        Returns the hash code for this object.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A 32-bit signed integer hash code.