RectangleF 結構

定義

儲存四個為一組的浮點數值 (Floating-Point Number),表示矩形的位置和大小。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 座標,其為這個 Y 結構之 HeightRectangleF 的總和。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 座標,其為這個 X 結構之 WidthRectangleF 的總和。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)

根據指定的數量來放大這個 RectangleFEnlarges 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()

將這個 SizeLocationRectangleF 轉換成人們可讀取的 (Human-Readable) 字串。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.

適用於