Size Struct
Definition
public value class Size : IEquatable<System::Drawing::Size>
[System.ComponentModel.TypeConverter(typeof(System.Drawing.SizeConverter))]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public struct Size : IEquatable<System.Drawing.Size>
type Size = struct
Public Structure Size
Implements IEquatable(Of Size)
- Inheritance
- Attributes
- Implements
Remarks
The Size class is used to specify a height and width through the Size property for Rectangle, RectangleF, Image, Icon and other graphics classes. You can perform operations on a Size by using the overloaded operators such as Addition, Subtraction, and Equality. The unit for the Height and Width of the Size structure depend on the PageUnit and PageScale settings for the Graphics object that is used to draw.
Constructors
Size(Int32, Int32) |
Initializes a new instance of the Size structure from the specified dimensions. |
Size(Point) |
Initializes a new instance of the Size structure from the specified Point structure. |
Fields
Empty |
Gets a Size structure that has a Height and Width value of 0. |
Properties
Height |
Gets or sets the vertical component of this Size structure. |
IsEmpty |
Tests whether this Size structure has width and height of 0. |
Width |
Gets or sets the horizontal component of this Size structure. |
Methods
Add(Size, Size) |
Adds the width and height of one Size structure to the width and height of another Size structure. |
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. |
Equals(Object) |
Tests to see whether the specified object is a Size structure with the same dimensions as this Size structure. |
Equals(Size) | |
GetHashCode() |
Returns a hash code for this Size structure. |
Round(SizeF) |
Converts the specified SizeF structure to a Size structure by rounding the values of the SizeF structure to the nearest integer values. |
Subtract(Size, Size) |
Subtracts the width and height of one Size structure from the width and height of another Size structure. |
ToString() |
Creates a human-readable string that represents this Size structure. |
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. |
Operators
Addition(Size, Size) |
Adds the width and height of one Size structure to the width and height of another Size structure. |
Division(Size, Int32) |
Divides the specified Size by the specified integer. |
Division(Size, Single) |
Divides the specified Size by the specified single-precision floating-point number. |
Equality(Size, Size) |
Tests whether two Size structures are equal. |
Explicit(Size to Point) | |
Implicit(Size to SizeF) | |
Inequality(Size, Size) |
Tests whether two Size structures are different. |
Multiply(Int32, Size) |
Multiplies the specified integer by the specified Size. |
Multiply(Single, Size) |
Multiplies the specified single-precision floating-point number by the specified Size. |
Multiply(Size, Int32) |
Multiplies the specified Size by the specified integer. |
Multiply(Size, Single) |
Multiplies the specified Size by the specified single-precision floating-point number. |
Subtraction(Size, Size) |
Subtracts the width and height of one Size structure from the width and height of another Size structure. |