Table of Contents

Struct XUnitPt

Namespace
PdfSharp.Drawing
Assembly
PdfSharp.dll

Represents a value with a unit of measure in point (1/72 inch). The structure converts implicitly from and to double.

public struct XUnitPt
Extension Methods

Constructors

XUnitPt(double)

Initializes a new instance of the XUnitPt class.

Fields

Zero

Represents a unit with all values zero.

Properties

Centimeter

Gets or sets the value in centimeter.

Inch

Gets or sets the value in inch.

Millimeter

Gets or sets the value in millimeter.

Point

Gets or sets the value in point.

Presentation

Gets or sets the value in presentation units (1/96 inch).

Value

Gets or sets the raw value of the object, which is always measured in point for XUnitPt.

Methods

CompareTo(XUnitPt)

Compares this XUnitPt with another XUnitPt value.

CompareTo(object?)

Compares this XUnitPt with another object.

Equals(object?)

Calls base class Equals.

FromCentimeter(double)

Returns an XUnitPt object. Converts the value to Point.

FromInch(double)

Returns an XUnitPt object. Converts the value to Point.

FromMillimeter(double)

Returns an XUnitPt object. Converts the value to Point.

FromPoint(double)

Returns an XUnitPt object.

FromPresentation(double)

Returns an XUnitPt object. Converts the value to Point.

GetHashCode()

Returns the hash code for this instance.

IsSameValue(XUnitPt)

Compares the actual values of this XUnitPt and another XUnitPt value tolerating rounding errors.

ToString()

Returns the object as string. The unit of measure is appended to the end of the string.

ToString(IFormatProvider?)

Returns the object as string using the format information. The unit of measure is appended to the end of the string.

Operators

operator +(XUnitPt, XUnitPt)

Adds an XUnitPt to an XUnitPt.

operator +(XUnitPt, string)

Adds a string parsed as XUnitPt to an XUnitPt.

operator /(XUnitPt, double)

Divides an XUnitPt by a double.

operator ==(XUnitPt, XUnitPt)

Memberwise comparison checking exact value. To compare by value tolerating rounding errors, use IsSameValue() or code like Math.Abs(a.Pt - b.Pt) < 1e-5.

operator >(XUnitPt, XUnitPt)

Compares two XUnitPt values.

operator >=(XUnitPt, XUnitPt)

Compares two XUnitPt values.

implicit operator XUnitPt(XUnit)

Converts an XUnit to an XUnitPt object.

implicit operator XUnit(XUnitPt)

Converts an XUnitPt to an XUnit object.

implicit operator double(XUnitPt)

Converts an XUnitPt to a double value as point.

implicit operator XUnitPt(double)

Converts a double to an XUnitPt object.

implicit operator XUnitPt(int)

Converts an int to an XUnitPt object.

implicit operator XUnitPt(string)

Converts a string to an XUnitPt object. If the string contains a suffix like 'cm' or 'in' the value will be converted to point.

operator !=(XUnitPt, XUnitPt)

Memberwise comparison checking exact value. To compare by value tolerating rounding errors, use IsSameValue() or code like Math.Abs(a.Pt - b.Pt) < 1e-5.

operator <(XUnitPt, XUnitPt)

Compares two XUnitPt values.

operator <=(XUnitPt, XUnitPt)

Compares two XUnitPt values.

operator *(XUnitPt, double)

Multiplies an XUnitPt with a double.

operator -(XUnitPt, XUnitPt)

Subtracts an XUnitPt from an XUnitPt.

operator -(XUnitPt, string)

Subtracts a string parsed as UnitPt from an XUnitPt.

operator -(XUnitPt)

Returns the negative value of an XUnitPt.