RectangleF 结构

定义

存储一组浮点数,共四个,表示一个矩形的位置和大小。Stores a set of four floating-point numbers that represent the location and size of a rectangle. 对于更高级的区域函数,请使用 Region 对象。For more advanced region functions, use a Region object.

public value class RectangleF : IEquatable<System::Drawing::RectangleF>
[System.Serializable]
public struct RectangleF : IEquatable<System.Drawing.RectangleF>
type RectangleF = struct
Public Structure RectangleF
Implements IEquatable(Of RectangleF)
继承
RectangleF
属性
实现

注解

矩形的宽度、高度和左上角定义。A rectangle is defined by its width, height, and upper-left corner.

构造函数

RectangleF(PointF, SizeF)

用指定的位置和大小初始化 RectangleF 类的新实例。Initializes a new instance of the RectangleF class with the specified location and size.

RectangleF(Single, Single, Single, Single)

用指定的位置和大小初始化 RectangleF 类的新实例。Initializes a new instance of the RectangleF class with the specified location and size.

字段

Empty

表示其成员未初始化的 RectangleF 类的实例。Represents an instance of the RectangleF class with its members uninitialized.

属性

Bottom

获取 y 坐标,该坐标是此 RectangleF 结构的 YHeight 之和。Gets the y-coordinate that is the sum of Y and Height of this RectangleF structure.

Height

获取或设置此 RectangleF 结构的高度。Gets or sets the height of this RectangleF structure.

IsEmpty

获取一个值,该值指示此 RectangleFWidthHeight 属性的值是否为零。Gets a value that indicates whether the Width or Height property of this RectangleF has a value of zero.

Left

获取此 RectangleF 结构左边缘的 x 坐标。Gets the x-coordinate of the left edge of this RectangleF structure.

Location

获取或设置此 RectangleF 结构左上角的坐标。Gets or sets the coordinates of the upper-left corner of this RectangleF structure.

Right

获取 x 坐标,该坐标是此 RectangleF 结构的 XWidth 之和。Gets the x-coordinate that is the sum of X and Width of this RectangleF structure.

Size

获取或设置此 RectangleF 的大小。Gets or sets the size of this RectangleF.

Top

获取此 RectangleF 结构上边缘的 y 坐标。Gets the y-coordinate of the top edge of this RectangleF structure.

Width

获取或设置此 RectangleF 结构的宽度。Gets or sets the width of this RectangleF structure.

X

获取或设置此 RectangleF 结构左上角的 x 坐标。Gets or sets the x-coordinate of the upper-left corner of this RectangleF structure.

Y

获取或设置此 RectangleF 结构左上角的 y 坐标。Gets or sets the y-coordinate of the upper-left corner of this RectangleF structure.

方法

Contains(PointF)

确定指定的点是否包含在此 RectangleF 结构内。Determines if the specified point is contained within this RectangleF structure.

Contains(RectangleF)

确定 rect 表示的矩形区域是否完全包含在此 RectangleF 结构内。Determines if the rectangular region represented by rect is entirely contained within this RectangleF structure.

Contains(Single, Single)

确定指定的点是否包含在此 RectangleF 结构内。Determines if the specified point is contained within this RectangleF structure.

Equals(Object)

测试 obj 是否为与此 RectangleF 具有相同位置和大小的 RectangleFTests whether obj is a RectangleF with the same location and size of this RectangleF.

Equals(RectangleF)
FromLTRB(Single, Single, Single, Single)

创建一个 RectangleF 结构,它的左上角和右下角都位于指定位置。Creates a RectangleF structure with upper-left corner and lower-right corner at the specified locations.

GetHashCode()

获取此 RectangleF 结构的哈希代码。Gets the hash code for this RectangleF structure. 有关如何使用哈希代码的信息,请参见 Object.GetHashCodeFor information about the use of hash codes, see Object.GetHashCode.

Inflate(RectangleF, Single, Single)

创建并返回指定 RectangleF 结构的放大副本。Creates and returns an enlarged copy of the specified RectangleF structure. 该副本被放大指定的量,并且不修改原始矩形。The copy is enlarged by the specified amount and the original rectangle remains unmodified.

Inflate(Single, Single)

将此 RectangleF 结构放大指定量。Enlarges this RectangleF structure by the specified amount.

Inflate(SizeF)

将此 RectangleF 放大指定量。Enlarges this RectangleF by the specified amount.

Intersect(RectangleF)

将此 RectangleF 结构替换为其自身与指定的 RectangleF 结构的交集。Replaces this RectangleF structure with the intersection of itself and the specified RectangleF structure.

Intersect(RectangleF, RectangleF)

返回表示两个矩形的交集的 RectangleF 结构。Returns a RectangleF structure that represents the intersection of two rectangles. 如果没有交集,将返回一个空的 RectangleFIf there is no intersection, and empty RectangleF is returned.

IntersectsWith(RectangleF)

确定此矩形是否与 rect 相交。Determines if this rectangle intersects with rect.

Offset(PointF)

将此矩形的位置调整指定的量。Adjusts the location of this rectangle by the specified amount.

Offset(Single, Single)

将此矩形的位置调整指定的量。Adjusts the location of this rectangle by the specified amount.

ToString()

将此 RectangleFLocationSize 转换为可读字符串。Converts the Location and Size of this RectangleF to a human-readable string.

Union(RectangleF, RectangleF)

创建第三个矩形,它是能够同时包含形成并集的两个矩形的可能的最小矩形。Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.

操作员

Equality(RectangleF, RectangleF)

测试两个 RectangleF 结构的位置和大小是否相同。Tests whether two RectangleF structures have equal location and size.

Implicit(Rectangle to RectangleF)

将指定的 Rectangle 结构转换为 RectangleF 结构。Converts the specified Rectangle structure to a RectangleF structure.

Inequality(RectangleF, RectangleF)

测试两个 RectangleF 结构的位置或大小是否不同。Tests whether two RectangleF structures differ in location or size.

适用于