Size Struct

Definition

Stores an ordered pair of integers, which specify a Height and Width.

public value class Size : IEquatable<System::Drawing::Size>
public value class Size
[System.ComponentModel.TypeConverter("System.Drawing.SizeConverter, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public struct Size : IEquatable<System.Drawing.Size>
public struct Size
public struct Size : IEquatable<System.Drawing.Size>
[System.ComponentModel.TypeConverter(typeof(System.Drawing.SizeConverter))]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public struct Size
[<System.ComponentModel.TypeConverter("System.Drawing.SizeConverter, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
type Size = struct
type Size = struct
[<System.ComponentModel.TypeConverter(typeof(System.Drawing.SizeConverter))>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type Size = struct
Public Structure Size
Implements IEquatable(Of Size)
Public Structure 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)

Indicates whether the current object is equal to another object of the same type.

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)

Converts the specified Size structure to a Point structure.

Implicit(Size to SizeF)

Converts the specified Size structure to a SizeF structure.

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.

Applies to