Click or drag to resize

Length Structure

Represents a length, distance or a coordinate.

Namespace:  GemBox.Presentation
Assembly:  GemBox.Presentation (in GemBox.Presentation.dll) Version: 21.3.35.1041 (21.3.35.1041)
Syntax
public struct Length : IComparable<Length>, 
	IEquatable<Length>, IFormattable

The Length type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberDefaultUnit
Gets or sets the default measurement unit that is applied globally every time Length is converted from/to a Double and to a String.
Top
Methods
  NameDescription
Public methodCompareTo
Compares the value of this instance to a specified Length value and returns an integer that indicates whether this instance is less than, equal to, or greater than the specified Length value.
Public methodEquals(Object)
Determines whether the specified Object is equal to this Length instance.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Length)
Determines whether the other Length is equal to this Length instance.
Public methodStatic memberFrom
Converts a length value in a specified measurement unit to a Length instance.
Public methodGetHashCode
Returns a hash code for this Length instance.
(Overrides ValueTypeGetHashCode.)
Public methodTo
Converts this Length instance to a length value in a specified measurement unit.
Public methodToString
Returns a String that represents this Length instance in a default measurement unit.
(Overrides ValueTypeToString.)
Public methodToString(LengthUnit)
Returns a String that represents this Length instance in a specified measurement unit.
Public methodToString(String, IFormatProvider)
Returns a String that represents this Length instance in a specified format and a default measurement unit by using a specified format provider.
Public methodToString(String, IFormatProvider, LengthUnit)
Returns a String that represents this Length instance in a specified format and a measurement unit by using a specified format provider.
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Determines whether first and second Lengths are equal.
Public operatorStatic member(Int64 to Length)
Converts a length value in an EMU (English Metric Unit) measurement unit to a Length instance.
Public operatorStatic member(Length to Int64)
Converts a Length instance to a length value in an EMU (English Metric Unit) measurement unit.
Public operatorStatic memberGreaterThan
Determines whether first Length is greater than second Length.
Public operatorStatic member(Double to Length)
Converts a length value in a default measurement unit to a Length instance.
Public operatorStatic member(Length to Double)
Converts a Length instance to a length value in a default measurement unit.
Public operatorStatic memberInequality
Determines whether first and second Lengths are not equal.
Public operatorStatic memberLessThan
Determines whether first Length is less than second Length.
Top
Remarks

Length internally stores its value in an Int64 field and internally uses EMU (English Metric Unit) as a unit of measurement.

EMU (English Metric Unit) can evenly divide in both English and Metric units and can avoid rounding errors during the calculation since it defines an integer based, high precision coordinate system (1" = 914 400 EMU, 1 cm = 360 000 EMU, 1 mm = 36 000 EMU, 1 pt = 12 700 EMU).

See Also