Struct Size
A width and a height.
public struct Size : IEquatable<Size>
- Implements
- Inherited Members
Constructors
Size(int, int)
Creates a size with the given width and height.
public Size(int width, int height)
Parameters
Properties
Height
The height.
public int Height { readonly get; set; }
Property Value
Width
The width.
public int Width { readonly get; set; }
Property Value
Methods
Equals(Size)
Whether other has the same width and height.
public readonly bool Equals(Size other)
Parameters
otherSize
Returns
Equals(object)
Whether obj is a Size with the same width and height.
public override readonly bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
Returns a hash code based on the width and height, consistent with Equals(object).
public override readonly int GetHashCode()
Returns
ToString()
Returns the size as (Width, Height).
public override readonly string ToString()
Returns
Operators
operator +(Size, Size)
Adds the widths and the heights of the two sizes.
public static Size operator +(Size a, Size b)
Parameters
Returns
operator /(Size, Size)
Divides the widths and the heights of a by those of b, using integer division. Throws DivideByZeroException when a component of b is zero.
public static Size operator /(Size a, Size b)
Parameters
Returns
operator ==(Size, Size)
Whether the two sizes have the same width and height.
public static bool operator ==(Size a, Size b)
Parameters
Returns
operator !=(Size, Size)
Whether the two sizes differ in width or height.
public static bool operator !=(Size a, Size b)
Parameters
Returns
operator *(Size, Size)
Multiplies the widths and the heights of the two sizes.
public static Size operator *(Size a, Size b)
Parameters
Returns
operator -(Size, Size)
Subtracts the widths and the heights of b from those of a.
public static Size operator -(Size a, Size b)