Xojo.Core.Rect.Intersection

From Xojo Documentation

Method

Xojo.Core.Rect.Intersection(Other As Xojo.Core.Rect) As Xojo.Core.Rect

Supported for all project types and targets.

Calculates the area of intersection with the other rect.

Sample Code

Var rect1 As New Xojo.Core.Rect(10, 10, 100, 100)
Var rect2 As New Xojo.Core.Rect(5, 5, 30, 30)
Var intersectRect As Xojo.Core.Rect
intersectRect = rect1.Intersection(rect2)