System::Drawing::Size class

Size class

Represents a pair of integer values that represent width and height of an image. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

class Size

Methods

MethodDescription
static Add(const Size&, const Size&)Returns a new Size object that is a sum of the specified Size object, i.e. whose width value is equal to the sum of width values of the specified objects and height value is equal to the sum of height values of the specified objects.
static Ceiling(const SizeF&)Constructs a Size object from the specified SizeF object by rounding the SizeF object’s width and height values to the next higher integer values.
Equals(const Size&) constDetermines if the current object and the specified object are equal, i.e. represent the same pair of width and hegiht values.
get_Height() constReturns the value of heght represented by the current object.
get_IsEmpty() constDetermines if both width and hegiht values are equal to 0.
get_Width() constReturns the value of width represented by the current object.
GetHashCode() constReturns a hash code for the current object.
operator Point() constConstructs an instance of Point object and initializes its X and Y coordinate with the current object’s width and height values correspondingly.
operator SizeF() constConstructs an instance of SizeF object and initializes it with width and hegiht values of the current Size object.
static Round(const SizeF&)Constructs a Size object from the specified SizeF object by rounding the SizeF object’s width and height values to the nearest integer values.
set_Height(int)Sets the value of height represented by the current object.
set_Width(int)Sets the value of width represented by the current object.
Size()Constructs a new Size object and initializes its width and height values with 0.
Size(const Point&)Constructs a new Size object and initializes its width and height values with the values of X and Y coordinates of the specifide point correspondingly.
Size(int, int)Constructs a new Size object and initializes it with the specified value.
static Subtract(const Size&, const Size&)Returns a new Size object that is the results of subctraction of size2 from size1, i.e. whose width value is the result of subtraction of size2’s width value from size1’s width value and height value is the result of subtraction of size2’s height value from size1’s height value.
ToString() constReturns the string representation of the pair of width and hegiht values represented by the current object.
static Truncate(const SizeF&)Constructs a Size object from the specified SizeF object by truncating the SizeF object’s width and height values to the next lower integer values.

Fields

FieldDescription
static EmptyAn empty instance of Size class whose width and height values are 0.

See Also