Class Unit

Class Unit

Namespace: Aspose.Html.Drawing
Assembly: Aspose.HTML.dll (25.2.0)

Provides the base class for units of measurement.

[ComVisible(true)]
public abstract class Unit : IEquatable<unit>

Inheritance

objectUnit

Derived

LengthOrAuto, Numeric

Implements

IEquatable<unit>

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

Unit(UnitType)

Initializes a new instance of the Aspose.Html.Drawing.Unit class.

protected Unit(UnitType type)

Parameters

type UnitType

The unit type.

Properties

UnitType

Gets the unit type of the Aspose.Html.Drawing.Unit.

public UnitType UnitType { get; }

Property Value

UnitType

Methods

Equals(Unit)

Determines whether the specified Aspose.Html.Drawing.Unit, is equal to this instance.

public virtual bool Equals(Unit other)

Parameters

other Unit

The Aspose.Html.Drawing.Unit to compare with this instance.

Returns

bool

true if the specified Aspose.Html.Drawing.Unit is equal to this instance; otherwise, false.

Equals(object)

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

public override bool Equals(object obj)

Parameters

obj object

The System.Object to compare with this instance.

Returns

bool

true if the specified System.Object is equal to this instance; otherwise, false.

FromCentimeters(double)

Returns a Aspose.Html.Drawing.Length object that is represented in centimeters.

public static Length FromCentimeters(double value)

Parameters

value double

The value.

Returns

Length

Returns a Aspose.Html.Drawing.Length object.

FromDegrees(double)

Returns a Aspose.Html.Drawing.Angle object that is represented in degrees.

public static Angle FromDegrees(double value)

Parameters

value double

The value.

Returns

Angle

Returns a Aspose.Html.Drawing.Angle object.

FromDotsPerCentimeters(double)

Returns a Aspose.Html.Drawing.Resolution object that is represented in dots per centimeters.

public static Resolution FromDotsPerCentimeters(double value)

Parameters

value double

The value.

Returns

Resolution

Returns a Aspose.Html.Drawing.Resolution object.

FromDotsPerInch(double)

Returns a Aspose.Html.Drawing.Resolution object that is represented in dots per inch.

public static Resolution FromDotsPerInch(double value)

Parameters

value double

The value.

Returns

Resolution

Returns a Aspose.Html.Drawing.Resolution object.

FromDotsPerPixel(double)

Returns a Aspose.Html.Drawing.Resolution object that is represented in dots per pixels.

public static Resolution FromDotsPerPixel(double value)

Parameters

value double

The value.

Returns

Resolution

Returns a Aspose.Html.Drawing.Resolution object.

FromGradians(double)

Returns a Aspose.Html.Drawing.Angle object that is represented in gradians.

public static Angle FromGradians(double value)

Parameters

value double

The value.

Returns

Angle

Returns a Aspose.Html.Drawing.Angle object.

FromHertz(double)

Returns a Aspose.Html.Drawing.Frequency object that is represented in hertz.

public static Frequency FromHertz(double value)

Parameters

value double

The value.

Returns

Frequency

Returns a Aspose.Html.Drawing.Frequency object.

FromInches(double)

Returns a Aspose.Html.Drawing.Length object that is represented in inches.

public static Length FromInches(double value)

Parameters

value double

The value.

Returns

Length

Returns a Aspose.Html.Drawing.Length object.

FromKiloHertz(double)

Returns a Aspose.Html.Drawing.Frequency object that is represented in kiloHertz.

public static Frequency FromKiloHertz(double value)

Parameters

value double

The value.

Returns

Frequency

Returns a Aspose.Html.Drawing.Frequency object.

FromMillimeters(double)

Returns a Aspose.Html.Drawing.Length object that is represented in millimeters.

public static Length FromMillimeters(double value)

Parameters

value double

The value.

Returns

Length

Returns a Aspose.Html.Drawing.Length object.

FromMilliseconds(double)

Returns a Aspose.Html.Drawing.Time object that is represented in milliseconds.

public static Time FromMilliseconds(double value)

Parameters

value double

The value.

Returns

Time

Returns a Aspose.Html.Drawing.Time object.

FromPicas(double)

Returns a Aspose.Html.Drawing.Length object that is represented in picas.

public static Length FromPicas(double value)

Parameters

value double

The value.

Returns

Length

Returns a Aspose.Html.Drawing.Length object.

FromPixels(double)

Returns a Aspose.Html.Drawing.Length object that is represented in pixels.

public static Length FromPixels(double value)

Parameters

value double

The value.

Returns

Length

Returns a Aspose.Html.Drawing.Length object.

FromPoints(double)

Returns a Aspose.Html.Drawing.Length object that is represented in points.

public static Length FromPoints(double value)

Parameters

value double

The value.

Returns

Length

Returns a Aspose.Html.Drawing.Length object.

FromQuarterMillimeters(double)

Returns a Aspose.Html.Drawing.Length object that is represented in quarter-millimeters.

public static Length FromQuarterMillimeters(double value)

Parameters

value double

The value.

Returns

Length

Returns a Aspose.Html.Drawing.Length object.

FromRadians(double)

Returns a Aspose.Html.Drawing.Angle object that is represented in radians.

public static Angle FromRadians(double value)

Parameters

value double

The value.

Returns

Angle

Returns a Aspose.Html.Drawing.Angle object.

FromSeconds(double)

Returns a Aspose.Html.Drawing.Time object that is represented in seconds.

public static Time FromSeconds(double value)

Parameters

value double

The value.

Returns

Time

Returns a Aspose.Html.Drawing.Time object.

FromTurns(double)

Returns a Aspose.Html.Drawing.Angle object that is represented in turns.

public static Angle FromTurns(double value)

Parameters

value double

The value.

Returns

Angle

Returns a Aspose.Html.Drawing.Angle object.

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

ToString()

Returns a System.String that represents this instance.

public override string ToString()

Returns

string

A System.String that represents this instance. </unit>