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

ImageAdjustmentParam 结构

Image adjustment parameters (internal structure) 图像调整参数(内部结构体)

Definition

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

备注

Contains parameters for image padding, scaling ratios and size information. Used for maintaining consistent image transformations across operations.

包含图像的填充量、缩放比例和尺寸信息等参数。 用于在各种图像操作中保持一致的变换处理。

示例

Basic usage:
C#
var param = ImageAdjustmentParam.CreateFromImageInfo(
    new Size(800, 600),
    new Size(400, 300),
    ImageResizeMode.Pad);

Rect adjustedRect = param.AdjustRect(originalRect);

构造函数

ImageAdjustmentParam Initializes a new instance of ImageAdjustmentParam 构造函数

属性

Padding Padding amounts for each side of the image (typically width/height) 图像各边的填充量(通常为宽/高)
Ratio Image scaling ratios (width/height) 图像的宽高比例调整系数
RowImgSize Original image size before adjustment 调整前的原始图像尺寸
TargetImgSize Target image size after adjustment 调整后的目标图像尺寸

方法

AdjustPoint Adjusts point coordinates using the current parameters 使用当前参数调整点坐标
AdjustRect Adjusts rectangle coordinates using the current parameters 使用当前参数调整矩形坐标
AdjustRectF Adjusts rectangle coordinates using the current parameters (floating-point precision) 使用当前参数调整矩形坐标(浮点精度)
CreateFromImageInfo Creates adjustment parameters from image specifications 根据图像信息创建调整参数
Deconstruct Deconstruct method (supports pattern matching and deconstruction) 解构方法(支持模式匹配和解构赋值)
Equals(ImageAdjustmentParam) Indicates whether the current object is equal to another object of the same type 指示当前对象是否等于同一类型的另一个对象
Equals(Object) Determines whether the specified object is equal to the current object 确定指定对象是否等于当前对象
(重写 ValueTypeEquals(Object))
GetHashCodeReturns the hash code for this instance.
(继承自 ValueType。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
ToString Returns a string that represents the current object 重写 ToString() 以便输出可读信息
(重写 ValueTypeToString)

运算符

Equality(ImageAdjustmentParam, ImageAdjustmentParam) Equality operator 相等运算符
Inequality(ImageAdjustmentParam, ImageAdjustmentParam) Inequality operator 不等运算符

参见