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

SizeD 结构

Represents a size with double-precision floating-point dimensions 表示具有双精度浮点尺寸的大小结构体

Definition

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

备注

Used for representing dimensions of rectangular areas with high precision. Suitable for calculations requiring decimal precision and gradual transformations.

用于表示需要高精度的矩形区域尺寸。 适合需要小数精度和渐变变换的计算。

示例

Basic usage:
C#
var preciseSize = new SizeD(1920.5678, 1080.1234);
Size intSize = preciseSize.ToSize(); // Explicit conversion
SizeD fromFloat = new SizeF(100.5f, 200.5f); // Implicit conversion

构造函数

SizeD Represents a size with double-precision floating-point dimensions 表示具有双精度浮点尺寸的大小结构体

方法

GetTypeGets the Type of the current instance.
(继承自 Object。)
ToSize Converts to integer-based Size (truncates decimal portion) 转换为整数Size(截断小数部分)
ToSizeF Converts to single-precision SizeF (may lose precision) 转换为单精度SizeF(可能丢失精度)
ToString Returns a string representation of the size 返回大小的字符串表示形式
(重写 ValueTypeToString)

运算符

(Size to SizeD) Implicit conversion from integer-based Size 从整数Size的隐式转换
(SizeF to SizeD) Implicit conversion from single-precision SizeF 从单精度SizeF的隐式转换

字段

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

参见