com.aspose.html.drawing

Class UnitType

  • All Implemented Interfaces:
    com.aspose.ms.System.IEquatable<UnitType>


    public final class UnitType
    extends Object
    implements com.aspose.ms.System.IEquatable<UnitType>

    Specifies the unit of measurement.

    • Field Detail

      • VIEWPORT_PERCENTAGE_UNIT

        public static final byte VIEWPORT_PERCENTAGE_UNIT
        See Also:
        Constant Field Values
      • EM

        public static final UnitType EM

        Measurement is relative to the height of the parent element's font.

      • EX

        public static final UnitType EX

        Measurement is relative to the height of the lowercase letter x of the parent element's font.

      • CH

        public static final UnitType CH

        Measurement is relative to width of the "0" (zero).

      • REM

        public static final UnitType REM

        Measurement is relative to font-size of the root element.

      • VW

        public static final UnitType VW

        Measurement is relative to 1% of the width of the viewport*

      • VH

        public static final UnitType VH

        Measurement is relative to 1% of the height of the viewport* Try it

      • VMIN

        public static final UnitType VMIN

        Measurement is relative to 1% of viewport's* smaller dimension Try it

      • VMAX

        public static final UnitType VMAX

        Measurement is relative to 1% of viewport's* larger dimension Try it

      • CM

        public static final UnitType CM

        Measurement is in centimeters

      • MM

        public static final UnitType MM

        Measurement is in millimeters

      • Q

        public static final UnitType Q

        Measurement is in quarter-millimeters

      • IN

        public static final UnitType IN

        Measurement is in inches

      • PC

        public static final UnitType PC

        Measurement is in picas

      • PT

        public static final UnitType PT

        Measurement is in points

      • PX

        public static final UnitType PX

        Measurement is in pixels

      • DEG

        public static final UnitType DEG

        Measurement is in degrees.

      • GRAD

        public static final UnitType GRAD

        Measurement is in gradians.

      • RAD

        public static final UnitType RAD

        Measurement is in radians.

      • TURN

        public static final UnitType TURN

        Measurement is in turns.

      • S

        public static final UnitType S

        Measurement is in seconds.

      • MS

        public static final UnitType MS

        Measurement is in milliseconds.

      • HZ

        public static final UnitType HZ

        Measurement is in hertz.

      • K_HZ

        public static final UnitType K_HZ

        Measurement is in kiloHertz.

      • DPI

        public static final UnitType DPI

        Measurement is in dots per inch.

      • DPCM

        public static final UnitType DPCM

        Measurement is in dots per centimeters.

      • DPPX

        public static final UnitType DPPX

        Measurement is in Dots per pixels unit.

      • AUTO

        public static final UnitType AUTO

        Measurement is not defined.

      • PERCENTAGE

        public static final UnitType PERCENTAGE

        Measurement is in percentage.

      • INTEGER

        public static final UnitType INTEGER

        Measurement is an integer number.

      • REAL

        public static final UnitType REAL

        Measurement is a real number.

    • Method Detail

      • getCategory

        public byte getCategory()

        Gets the unit category code.

        Value: The category.
      • getMultiplier

        public int getMultiplier()
      • getFraction

        public UnitType getFraction()

        The default unit type is used for storage the fraction part of the UnitType.

        Value: The type of the defaul.
      • equals

        public boolean equals(Object obj)

        Determines whether the specified System.Object, is equal to this instance.

        Specified by:
        equals in interface com.aspose.ms.System.IEquatable<UnitType>
        Overrides:
        equals in class Object
        Parameters:
        obj - The System.Object to compare with this instance.
        Returns:
        true if the specified System.Object is equal to this instance; otherwise, false.
      • equals

        public boolean equals(UnitType other)

        Determines whether the specified UnitType, is equal to this instance.

        Parameters:
        other - The UnitType to compare with this instance.
        Returns:
        true if the specified UnitType is equal to this instance; otherwise, false.
      • hashCode

        public int hashCode()

        Returns a hash code for this instance.

        Overrides:
        hashCode in class Object
        Returns:
        A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
      • op_Equality

        public static boolean op_Equality(UnitType first,
                                          UnitType second)

        Determines whether the two specified UnitType values are equal.

        Parameters:
        first - The first UnitType value to compare.
        second - The second UnitType value to compare.
        Returns:
        true if the both UnitType are equal; otherwise, false.
      • op_Inequality

        public static boolean op_Inequality(UnitType first,
                                            UnitType second)

        Determines whether the two specified UnitType values are not equal.

        Parameters:
        first - The first UnitType value to compare.
        second - The second UnitType value to compare.
        Returns:
        true if the both UnitType are not equal; otherwise, false.
      • toString

        public String toString()

        Returns a System.String that represents this instance.

        Overrides:
        toString in class Object
        Returns:
        A System.String that represents this instance.
      • to_UnitType

        public static UnitType to_UnitType(String value)

        Performs an implicit conversion from System.String to UnitType.

        Parameters:
        value - The value.
        Returns:
        The result of the conversion.
      • to_String

        public static String to_String(UnitType value)

        Performs an explicit conversion from UnitType to System.String.

        Parameters:
        value - The value.
        Returns:
        The result of the conversion.