Size Size Size Size Struct

定义

存储一个有序整数对,用于指定 HeightWidthStores an ordered pair of integers, which specify a Height and Width.

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)
继承
属性
实现

注解

Rectangle类用于Size通过、 Icon 、和其他图形类的属性指定高度和宽度。RectangleF Size ImageThe Size class is used to specify a height and width through the Size property for Rectangle, RectangleF, Image, Icon and other graphics classes. 您可以使用重载的运算符Size Addition(如、 SubtractionEquality) 对执行操作。You can perform operations on a Size by using the overloaded operators such as Addition, Subtraction, and Equality. Height PageUnit PageScale 结构和Graphics的单位取决于用于绘制的对象的和设置。 Width SizeThe 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.

构造函数

Size(Point) Size(Point) Size(Point) Size(Point)

根据指定的 Point 结构初始化 Size 结构的新实例。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)

根据指定的维度初始化 Size 结构的新实例。Initializes a new instance of the Size structure from the specified dimensions.

字段

Empty Empty Empty Empty

获取 HeightWidth 值为 0 的 Size 结构。Gets a Size structure that has a Height and Width value of 0.

属性

Height Height Height Height

获取或设置此 Size 结构的垂直组件。Gets or sets the vertical component of this Size structure.

IsEmpty IsEmpty IsEmpty IsEmpty

测试此 Size 结构的宽度和高度是否为 0。Tests whether this Size structure has width and height of 0.

Width Width Width Width

获取或设置此 Size 结构的水平组件。Gets or sets the horizontal component of this Size structure.

方法

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

将一个 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)

通过将 Size 结构的值舍入到最近的较大整数值,将指定的 SizeF 结构转换为 Size 结构。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)

测试指定的对象是否为与此 Size 结构具有相同维度的 Size 结构。Tests to see whether the specified object is a Size structure with the same dimensions as this Size structure.

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

返回此 Size 结构的哈希代码。Returns a hash code for this Size structure.

Round(SizeF) Round(SizeF) Round(SizeF) Round(SizeF)

通过将 SizeF 结构的值舍入到最近的较大整数值,将指定的 SizeF 结构转换为 Size 结构。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)

用另一个 Size 结构的宽度和高度减去一个 Size 结构的宽度和高度。Subtracts the width and height of one Size structure from the width and height of another Size structure.

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

创建一个表示此 Size 结构的用户可读的字符串。Creates a human-readable string that represents this Size structure.

Truncate(SizeF) Truncate(SizeF) Truncate(SizeF) Truncate(SizeF)

通过将 SizeF 结构的值截断到最近的较小整数值,将指定的 SizeF 结构转换为 Size 结构。Converts the specified SizeF structure to a Size structure by truncating the values of the SizeF structure to the next lower integer values.

操作员

Addition(Size, Size) Addition(Size, Size) Addition(Size, Size) Addition(Size, Size)

将一个 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)

将指定的 Size 除以指定的整数。Divides the specified Size by the specified integer.

Division(Size, Single) Division(Size, Single) Division(Size, Single) Division(Size, Single)

将指定的 Size 除以指定的单精度浮点数。Divides the specified Size by the specified single-precision floating-point number.

Equality(Size, Size) Equality(Size, Size) Equality(Size, Size) Equality(Size, 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)

将指定的 Size 结构转换为 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)

将指定的 Size 结构转换为 SizeF 结构。Converts the specified Size structure to a SizeF structure.

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

测试两个 Size 结构是否不同。Tests whether two Size structures are different.

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

将指定的 Size 与指定的整数相乘。Multiplies the specified Size by the specified integer.

Multiply(Size, Single) Multiply(Size, Single) Multiply(Size, Single) Multiply(Size, Single)

将指定的 Size 与指定的单精度浮点数相乘。Multiplies the specified Size by the specified single-precision floating-point number.

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

将指定的整数与指定的 Size 相乘。Multiplies the specified integer by the specified Size.

Multiply(Single, Size) Multiply(Single, Size) Multiply(Single, Size) Multiply(Single, Size)

将指定的单精度浮点数与指定的 Size 相乘。Multiplies the specified single-precision floating-point number by the specified Size.

Subtraction(Size, Size) Subtraction(Size, Size) Subtraction(Size, Size) Subtraction(Size, Size)

用另一个 Size 结构的宽度和高度减去一个 Size 结构的宽度和高度。Subtracts the width and height of one Size structure from the width and height of another Size structure.

适用于