Namespace: System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
Assembly: System.Drawing (in System.Drawing.dll)
Syntax
<SerializableAttribute> _
<TypeConverterAttribute(GetType(SizeConverter))> _
<ComVisibleAttribute(True)> _
Public Structure Size[SerializableAttribute]
[TypeConverterAttribute(typeof(SizeConverter))]
[ComVisibleAttribute(true)]
public struct Size[SerializableAttribute]
[TypeConverterAttribute(typeof(SizeConverter))]
[ComVisibleAttribute(true)]
public value class Size[<Sealed>]
[<SerializableAttribute>]
[<TypeConverterAttribute(typeof(SizeConverter))>]
[<ComVisibleAttribute(true)>]
type Size = struct endThe Size type exposes the following members.
Constructors
Top
| Name | Description | |
|---|---|---|
![]() | Size(Point) | Initializes a new instance of the Size structure from the specified Point structure. |
![]() | Size(Int32, Int32) | Initializes a new instance of the Size structure from the specified dimensions. |
Methods
Top
| Name | Description | |
|---|---|---|
![]() ![]() | Add | Adds the width and height of one Size structure to the width and height of another Size structure. |
![]() ![]() | Ceiling | Converts the specified SizeF structure to a Size structure by rounding the values of the Size structure to the next higher integer values. |
![]() | Equals | Tests to see whether the specified object is a Size structure with the same dimensions as this Size structure. (Overrides ValueType |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Returns a hash code for this Size structure. (Overrides ValueType |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | Round | Converts the specified SizeF structure to a Size structure by rounding the values of the SizeF structure to the nearest integer values. |
![]() ![]() | Subtract | 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. (Overrides ValueType |
![]() ![]() | Truncate | Converts the specified SizeF structure to a Size structure by truncating the values of the SizeF structure to the next lower integer values. |
Operators
Top
| Name | Description | |
|---|---|---|
![]() ![]() | Addition | Adds the width and height of one Size structure to the width and height of another Size structure. |
![]() ![]() | Equality | Tests whether two Size structures are equal. |
![]() ![]() | Converts the specified Size structure to a Point structure. | |
![]() ![]() | Converts the specified Size structure to a SizeF structure. | |
![]() ![]() | Inequality | Tests whether two Size structures are different. |
![]() ![]() | Subtraction | Subtracts the width and height of one Size structure from the width and height of another Size structure. |
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(Size, Size), Subtraction(Size, Size), and Equality(Size, Size). 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.
Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements..gif)
.gif)
.gif)
.gif)
.gif)
.gif)