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

RotatedRect 结构

Represents a rectangle that can be rotated around its center point 表示可围绕其中心点旋转的矩形

Definition

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

备注

Stores rotation information and provides methods to calculate rotated corners and bounding boxes. Rotation is performed clockwise around the center point.

存储旋转信息并提供计算旋转角和边界框的方法。 旋转围绕中心点顺时针进行。

示例

Basic usage:
C#
var rect = new RotatedRect(new PointF(100, 100), new SizeF(200, 100), 45);
PointF[] corners = rect.Points();
Rect boundingBox = rect.BoundingRect();

构造函数

RotatedRect Initializes a new rotated rectangle 初始化一个新的旋转矩形

方法

BoundingRect Calculates the axis-aligned bounding rectangle that encompasses the rotated rectangle 计算包含旋转矩形的最小轴对齐边界矩形
FromAxisAlignedRect Creates a rotated rectangle from an axis-aligned rectangle 从轴对齐矩形创建旋转矩形
GetTypeGets the Type of the current instance.
(继承自 Object。)
Points Computes the four corner points of the rotated rectangle 计算旋转矩形的四个角点
ToString Returns a formatted string representation of the rotated rectangle 返回旋转矩形的格式化字符串表示
(重写 ValueTypeToString)

字段

Angle The rotation angle in degrees 旋转角度(以度为单位)
Center The center point of the rectangle 矩形的中心点
Size The dimensions (width and height) of the rectangle 矩形的尺寸(宽度和高度)

参见