Sets DlxRect equal to the intersection of two rectangles. The intersection is the largest rectangle contained in both existing rectangles.
Syntax: |
---|
DlxRect.Intersect(rect) DlxRect.Intersect(rect1, rect2) |
Parameters
Parameter | Description |
---|---|
rect | DlxRect object that contains a source rectangle. |
rect1 | DlxRect object that contains a source rectangle. |
rect2 | DlxRect object that contains a source rectangle. |
Return Value
Returns true if the intersection is not empty; false if the intersection is empty.
Example
Copy code | |
---|---|
var r1 = new DlxRect(125, 0, 150, 200);
var r2 = new DlxRect(0, 75, 350, 95);
var r = new DlxRect();
r.Intersect(r1, r2);
DlxApp.Printf("r.left=%.2f, r.bottom=%.2f, r.right=%.2f, r.top=%.2f", r.left, r.bottom, r.right, r.top);
r.CopyRect(r1);
r.Intersect(r2);
DlxApp.Printf("r.left=%.2f, r.bottom=%.2f, r.right=%.2f, r.top=%.2f", r.left, r.bottom, r.right, r.top);
|