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

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