Size

Size structure

Represents size.

public struct Size

Constructors

NameDescription
Size(Point)Initializes a new instance of the Size structure from the specified Point.
Size(int, int)Initializes a new instance of the Size structure from the specified dimensions.

Properties

NameDescription
static Empty { get; }Gets a new instance of the Size structure that has Width and Height values set to zero.
Height { get; set; }Gets or sets the vertical component of this Size.
IsEmpty { get; }Gets a value indicating whether this Size has width and height of 0.
Width { get; set; }Gets or sets the horizontal component of this Size.

Methods

NameDescription
static Add(Size, Size)Adds the width and height of one Size structure to the width and height of another Size structure.
static 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.
static Round(SizeF)Converts the specified SizeF structure to a Size structure by rounding the values of the SizeF structure to the nearest integer values.
static Subtract(Size, Size)Subtracts the width and height of one Size structure from the width and height of another Size structure.
static 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.
override Equals(object)Tests to see whether the specified object is a Size with the same dimensions as this Size.
override GetHashCode()Returns a hash code for this Size structure.
override ToString()Creates a human-readable string that represents this Size.
operator +Adds the width and height of one Size structure to the width and height of another Size structure.
operator ==Tests whether two Size structures are equal.
explicit operatorConverts the specified Size to a Point.
implicit operatorConverts the specified Size to a SizeF.
operator !=Tests whether two Size structures are different.
operator -Subtracts the width and height of one Size structure from the width and height of another Size structure.

See Also