Length Structure

Length structure

An immutable absolute length. 96 CSS px = 72 pt = 25.4 mm.

public readonly struct Length : IEquatable<Length>

Properties

NameDescription
CssPixels { get; }The length in CSS px.
Unit { get; }The unit: px, pt or mm.
Value { get; }The number in Length.Unit.

Methods

NameDescription
Equals(Length)Equality of value and unit.
Equals(object?)Tells whether this instance and the given object are equal.
GetHashCode()Returns the hash code of this instance.
static Mm(double)A length in millimetres.
static Pt(double)A length in points.
static Px(double)A length in CSS px.
ToString()The CSS text, e.g. 12mm.

Operators

NameDescription
op_Equality(Length, Length)Equality.
op_Inequality(Length, Length)Inequality.

See Also