Class Unit

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

public final class Unit extends 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.getParameters().getBarcode().getBarHeight().setMillimeters(10);
    generator.save("test.png");
        

  • Constructor Summary

    Constructors
    Constructor
    Description
    Unit(Unit source)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determines whether this instance and a specified object, which must also be a Unit object, have the same value.
    float
    Gets size value in document units.
    float
    Gets size value in inches.
    float
    Gets size value in millimeters.
    float
    Gets size value in pixels.
    float
    Gets size value in point.
    float
     
    int
    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.
    Returns a human-readable string representation of this Unit.
    void
    updateResolution(float dpi)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Unit

      public Unit(Unit source)
  • Method Details

    • getPixels

      public float getPixels()

      Gets size value in pixels.

    • setPixels

      public void setPixels(float value)

      Sets size value in pixels.

    • 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 String toString()

      Returns a human-readable string representation of this Unit.

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

      public boolean equals(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 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 Object
      Returns:
      A 32-bit signed integer hash code.
    • getResolution

      public float getResolution()
    • updateResolution

      public void updateResolution(float dpi)