Struct Size
Represents size.
public struct Size
- Inherited Members
Constructors
Size(Point)
public Size(Point point)
Parameters
Size(int, int)
Initializes a new instance of the Size structure from the specified dimensions.
public Size(int width, int height)
Parameters
Properties
Empty
public static Size Empty { get; }
Property Value
Height
Gets or sets the vertical component of this Size.
public int Height { get; set; }
Property Value
IsEmpty
Gets a value indicating whether this Size has width and height of 0.
public bool IsEmpty { get; }
Property Value
Width
Gets or sets the horizontal component of this Size.
public int Width { get; set; }
Property Value
Methods
Add(Size, Size)
public static Size Add(Size size1, Size size2)
Parameters
Returns
Ceiling(SizeF)
Converts the specified SizeF structure to a Size structure by rounding the values of the Size structure to the next higher integer values.
public static Size Ceiling(SizeF size)
Parameters
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
Returns
GetHashCode()
Returns a hash code for this Size structure.
public override int GetHashCode()
Returns
Round(SizeF)
Converts the specified SizeF structure to a Size structure by rounding the values of the SizeF structure to the nearest integer values.
public static Size Round(SizeF size)
Parameters
Returns
Subtract(Size, Size)
Subtracts the width and height of one Size structure from the width and height of another Size structure.
public static Size Subtract(Size size1, Size size2)
Parameters
size1
SizeThe Size structure on the left side of the subtraction operator.
size2
SizeThe Size structure on the right side of the subtraction operator.
Returns
ToString()
Creates a human-readable string that represents this Size.
public override string ToString()
Returns
Truncate(SizeF)
Converts the specified SizeF structure to a Size structure by truncating the values of the SizeF structure to the next lower integer values.
public static Size Truncate(SizeF size)
Parameters
Returns
Operators
operator +(Size, Size)
public static Size operator +(Size size1, Size size2)
Parameters
Returns
operator ==(Size, Size)
Tests whether two Size structures are equal.
public static bool operator ==(Size size1, Size size2)
Parameters
size1
SizeThe Size structure on the left side of the equality operator.
size2
SizeThe Size structure on the right of the equality operator.
Returns
- bool
True if
size1
andsize2
have equal width and height; otherwise, false.
explicit operator Point(Size)
public static explicit operator Point(Size size)
Parameters
Returns
implicit operator SizeF(Size)
public static implicit operator SizeF(Size size)
Parameters
Returns
operator !=(Size, Size)
Tests whether two Size structures are different.
public static bool operator !=(Size size1, Size size2)
Parameters
size1
SizeThe Size structure on the left of the inequality operator.
size2
SizeThe Size structure on the right of the inequality operator.
Returns
- bool
True if
size1
andsize2
differ either in width or height; false ifsize1
andsize2
are equal.
operator -(Size, Size)
Subtracts the width and height of one Size structure from the width and height of another Size structure.
public static Size operator -(Size size1, Size size2)
Parameters
size1
SizeThe Size structure on the left side of the subtraction operator.
size2
SizeThe Size structure on the right side of the subtraction operator.