Size Size Struct

Definition

Struct defining height and width as a pair of doubles.

[System.Diagnostics.DebuggerDisplay("Width={Width}, Height={Height}")]
public struct Size
type Size = struct
Inheritance
Attributes

Remarks

Application developers should be aware of the limits of floating-point representations, specifically the possibility of incorrect comparisons and equality checks for values with small differences. David Goldberg's paper What Every Computer Scientist Should Know About Floating-Point Arithmetic describes the issues excellently.

Constructors

Size(Double, Double) Size(Double, Double)

Creates a new Size object with width and height.

Fields

Zero Zero

The Size whose values for height and width are 0.0.

Properties

Height Height

Magnitude along the vertical axis, in platform-specific units.

IsZero IsZero

Whether the Size has Height and Width of 0.0.

Width Width

Magnitude along the horizontal axis, in platform-defined units.

Methods

Deconstruct(Double, Double) Deconstruct(Double, Double)

Stores the components of the size in the corresponding arguments.

Equals(Object) Equals(Object)

Whether thisSize is equivalent to obj.

Equals(Size) Equals(Size)

Whether thisSize is equivalent to other.

GetHashCode() GetHashCode()

Returns a hash value for the Size.

ToString() ToString()

Returns a human-readable representation of the Size.

Operators

Addition(Size, Size) Addition(Size, Size)

Returns a new Size whose Height and Width are the sum of the component's height and width.

Equality(Size, Size) Equality(Size, Size)

Whether two Sizes have equal values.

Explicit(Size to Point) Explicit(Size to Point)

Returns a new Point based on a Size.

Inequality(Size, Size) Inequality(Size, Size)

Whether two Sizes have unequal values.

Multiply(Size, Double) Multiply(Size, Double)

Scales both Width and Height.

Subtraction(Size, Size) Subtraction(Size, Size)

Returns a new Size whose Height and Width are s1's height and width minus the values in s2.

Applies to