Struct Size
Represents the size of a rectangular region with an ordered pair of width and height.
public struct Size
- Inherited Members
Constructors
Size(Point)
public Size(Point pt)
Parameters
pt
Point
Size(int, int)
Initializes a new instance of the Size class from the specified dimensions.
public Size(int width, int height)
Parameters
Fields
Empty
Initializes a new instance of the Size class.
public static readonly Size Empty
Field Value
Properties
Height
Represents the vertical component of this Size.
public int Height { readonly get; set; }
Property Value
IsEmpty
Tests whether this Size has zero width and height.
public readonly bool IsEmpty { get; }
Property Value
Width
Represents the horizontal component of this Size.
public int Width { readonly get; set; }
Property Value
Methods
Add(Size, Size)
Performs vector addition of two Size objects.
public static Size Add(Size sz1, Size sz2)
Parameters
Returns
Equals(Size)
public readonly bool Equals(Size other)
Parameters
other
Size
Returns
Equals(object?)
public override readonly bool Equals(object? other)
Parameters
other
object
Returns
GetHashCode()
Returns a hash code.
public override readonly int GetHashCode()
Returns
Subtract(Size, Size)
public static Size Subtract(Size sz1, Size sz2)
Parameters
Returns
ToString()
Creates a human-readable string that represents this Size.
public override readonly string ToString()
Returns
Operators
operator +(Size, Size)
Performs vector addition of two Size objects.
public static Size operator +(Size sz1, Size sz2)
Parameters
Returns
operator /(Size, int)
public static Size operator /(Size left, int right)
Parameters
Returns
operator ==(Size, Size)
Tests whether two Size objects are identical.
public static bool operator ==(Size sz1, Size sz2)
Parameters
Returns
explicit operator Point(Size)
public static explicit operator Point(Size size)
Parameters
size
Size
Returns
operator !=(Size, Size)
Tests whether two Size objects are different.
public static bool operator !=(Size sz1, Size sz2)
Parameters
Returns
operator *(Size, int)
public static Size operator *(Size left, int right)
Parameters
Returns
operator *(int, Size)
public static Size operator *(int left, Size right)
Parameters
Returns
operator -(Size, Size)
public static Size operator -(Size sz1, Size sz2)