How to check if two rectangles intersect in WPF

I have two rectangles in a WPF application. How can I check if rectangles intersect or not?

+3
source share
3 answers
if (rectangle1.IntersectsWith(rectangle2)) { // Do something } 

Rect.IntersectWith

+7
source

Rect.IntersectsWith maybe what you are looking for?

+4
source

try the IntersectsWith method.

0
source

Source: https://habr.com/ru/post/1491294/


All Articles