Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

Size 结构

Represents a size with integer width and height dimensions 表示具有整数宽度和高度尺寸的大小

Definition

命名空间: DeploySharp.Data
程序集: DeploySharp (在 DeploySharp.dll 中) 版本:0.0.4+6e8a2e904469617cd59619d666c0e272985c0e33
C#
public struct Size : IEquatable<Size>
Inheritance
Object    ValueType    Size
Implements
IEquatableSize

备注

Used for representing dimensions of rectangular areas in integer units. Suitable for pixel-based operations and discrete coordinate systems.

用于表示矩形区域的整数单位尺寸。 适用于基于像素的操作和离散坐标系。

示例

Basic usage:
C#
var size = new Size(1920, 1080); // HD resolution
var fromDouble = new Size(1920.7, 1080.3); // Will truncate to (1920, 1080)

构造函数

Size(Double, Double) Initializes a new size from floating-point dimensions 从浮点尺寸初始化新大小
Size(Int32, Int32) Represents a size with integer width and height dimensions 表示具有整数宽度和高度尺寸的大小

方法

GetTypeGets the Type of the current instance.
(继承自 Object。)
ToString Returns a string representation of the size 返回大小的字符串表示形式
(重写 ValueTypeToString)

运算符

(SizeD to Size) Explicit conversion from SizeD to Size 从SizeD到Size的显式转换
(SizeF to Size) Explicit conversion from SizeF to Size 从SizeF到Size的显式转换

字段

Height Gets or sets the vertical dimension 获取或设置垂直尺寸
Width Gets or sets the horizontal dimension 获取或设置水平尺寸

参见