Size 结构

定义

描述对象的宽度和高度。Describes the width and height of an object.

public value class Size
public struct Size
[System.Security.SecurityCritical]
public struct Size
type Size = struct
Public Structure Size
继承
属性

注解

此结构表示 Windows 运行时(WinRT) Size 结构的 .NET 投影。This struct represents the .NET projection of the Windows Runtime (WinRT) Size struct. 有关详细信息,请参阅 UWP API 参考中的大小For more information, see Size in the UWP API reference.

构造函数

Size(Double, Double)

初始化 Size 结构的新实例,并为其分配初始宽度和高度。Initializes a new instance of the Size struct and assigns it an initial width and height.

属性

Empty

获取一个值,它表示空的 SizeGets a value that represents an empty Size.

Height

获取或设置此 Size 实例的高度。Gets or sets the height of this instance of Size.

IsEmpty

获取一个值,该值指示此 Size 实例是否为 EmptyGets a value that indicates whether this instance of Size is Empty.

Width

获取或设置此 Size 实例的宽度。Gets or sets the width of this instance of Size.

方法

Equals(Object)

比较某个对象与 Size 的实例是否相等。Compares an object to an instance of Size for equality.

Equals(Size)

比较某个值与 Size 的实例是否相等。Compares a value to an instance of Size for equality.

GetHashCode()

获取 Size 的此实例的哈希代码。Gets the hash code for this instance of Size.

ToString()

返回此 Size 的字符串表示形式。Returns a string representation of this Size.

运算符

Equality(Size, Size)

比较 Size 的两个实例是否相等。Compares two instances of Size for equality.

Inequality(Size, Size)

比较 Size 的两个实例是否不相等。Compares two instances of Size for inequality.

扩展方法

ToVector2(Size)

适用于

另请参阅