System.Types.IntersectRect
Delphi
function IntersectRect(const Rect1, Rect2: TRect): Boolean;
function IntersectRect(out Rect: TRect; const R1, R2: TRect): Boolean;
function IntersectRect(const Rect1, Rect2: TRectF): Boolean;
function IntersectRect(out Rect: TRectF; const R1, R2: TRectF): Boolean;
C++
extern DELPHI_PACKAGE bool __fastcall IntersectRect(const TRect &Rect1, const TRect &Rect2)/* overload */;
プロパティ
| 種類 | 可視性 | ソース | ユニット | 親 |
|---|---|---|---|---|
| function | public | System.Types.pas System.Types.hpp |
System.Types | System.Types |
説明
2 つの四角形の交差部分を返します。
IntersectRect を呼び出すと、R1 と R2 が交差する部分である四角形を取得することができます。交差部分は Rect パラメータで返されます。
IntersectRect は、2 つの四角形によって交差する部分がある場合に、True を返します。R1 と R2 が交差しない場合、IntersectRect は False を返し、Rect パラメータは Width と Height が共に 0 で位置が (0,0) の四角形に設定されます。