Size Size Size Size Struct

Definition

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

public value class Size
[System.ComponentModel.TypeConverter(typeof(System.Drawing.SizeConverter))]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public struct Size
type Size = struct
Public Structure Size
Inheritance
Attributes

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(Point) Size(Point) Size(Point) Size(Point)

Initializes a new instance of the Size structure from the specified Point structure.

Size(Int32, Int32) Size(Int32, Int32) Size(Int32, Int32) Size(Int32, Int32)

Initializes a new instance of the Size structure from the specified dimensions.

Fields

Empty Empty Empty Empty

Gets a Size structure that has a Height and Width value of 0.

Properties

Height Height Height Height

Gets or sets the vertical component of this Size structure.

IsEmpty IsEmpty IsEmpty IsEmpty

Tests whether this Size structure has width and height of 0.

Width Width Width Width

Gets or sets the horizontal component of this Size structure.

Methods

Add(Size, Size) Add(Size, Size) Add(Size, Size) Add(Size, Size)

Adds the width and height of one Size structure to the width and height of another Size structure.

Ceiling(SizeF) Ceiling(SizeF) Ceiling(SizeF) 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(Size) Equals(Size) Equals(Size) Equals(Size)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Tests to see whether the specified object is a Size structure with the same dimensions as this Size structure.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Returns a hash code for this Size structure.

Round(SizeF) Round(SizeF) Round(SizeF) 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) Subtract(Size, Size) Subtract(Size, Size) Subtract(Size, Size)

Subtracts the width and height of one Size structure from the width and height of another Size structure.

ToString() ToString() ToString() ToString()

Creates a human-readable string that represents this Size structure.

Truncate(SizeF) Truncate(SizeF) Truncate(SizeF) 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) Addition(Size, Size) Addition(Size, Size) Addition(Size, Size)

Adds the width and height of one Size structure to the width and height of another Size structure.

Division(Size, Int32) Division(Size, Int32) Division(Size, Int32) Division(Size, Int32)
Division(Size, Single) Division(Size, Single) Division(Size, Single) Division(Size, Single)
Equality(Size, Size) Equality(Size, Size) Equality(Size, Size) Equality(Size, Size)

Tests whether two Size structures are equal.

Explicit(Size to Point) Explicit(Size to Point) Explicit(Size to Point) Explicit(Size to Point)

Converts the specified Size structure to a Point structure.

Implicit(Size to SizeF) Implicit(Size to SizeF) Implicit(Size to SizeF) Implicit(Size to SizeF)

Converts the specified Size structure to a SizeF structure.

Inequality(Size, Size) Inequality(Size, Size) Inequality(Size, Size) Inequality(Size, Size)

Tests whether two Size structures are different.

Multiply(Size, Int32) Multiply(Size, Int32) Multiply(Size, Int32) Multiply(Size, Int32)
Multiply(Size, Single) Multiply(Size, Single) Multiply(Size, Single) Multiply(Size, Single)
Multiply(Int32, Size) Multiply(Int32, Size) Multiply(Int32, Size) Multiply(Int32, Size)
Multiply(Single, Size) Multiply(Single, Size) Multiply(Single, Size) Multiply(Single, Size)
Subtraction(Size, Size) Subtraction(Size, Size) Subtraction(Size, Size) Subtraction(Size, Size)

Subtracts the width and height of one Size structure from the width and height of another Size structure.

Applies to