public struct SizeF : IEquatable<SizeF>
Used for representing dimensions of rectangular areas with floating-point precision. Suitable for graphics operations, UI layout, and other scenarios requiring decimal values.
用于表示需要浮点精度的矩形区域尺寸。 适用于图形操作、UI布局等需要小数值的场景。
var floatSize = new SizeF(100.5f, 200.75f);
Size intSize = floatSize.ToSize(); // Explicit conversion (truncates)
SizeF fromDouble = (SizeF)new SizeD(150.7, 250.3); // Explicit conversion
SizeF(Double, Double) | Initializes a new SizeF from double-precision values 从双精度值初始化新SizeF |
SizeF(Single, Single) | Represents a size with single-precision floating-point dimensions 表示具有单精度浮点尺寸的大小结构体 |
GetType | Gets the Type of the current instance. (继承自 Object。) |
ToSize | Converts to integer-based Size (truncates decimal portion) 转换为整数Size(截断小数部分) |
ToSizeD | Converts to double-precision SizeD 转换为双精度SizeD |
ToString |
Returns a string representation of the size
返回大小的字符串表示形式
(重写 ValueTypeToString) |
(SizeD to SizeF) | Explicit conversion from double-precision SizeD 从双精度SizeD的显式转换 |
(Size to SizeF) | Implicit conversion from integer-based Size 从整数Size的隐式转换 |
Height | Gets or sets the vertical dimension 获取或设置垂直尺寸 |
Width | Gets or sets the horizontal dimension 获取或设置水平尺寸 |