我有 2 个矩形,我想知道相交的左上点 + 宽度和高度
//image
Rectangle rectangle1 = new Rectangle(121, 74, 614, 240);
//crop area
Rectangle rectangle2 = new Rectangle(40, -40, 240, 240);
Rectangle rectangle3 = new Rectangle();
if (rectangle1.IntersectsWith(rectangle2))
{
rectangle3 = Rectangle.Intersect(rectangle2, rectangle1);
}
在 rectangle3 我有结果 {X = 121 Y = 74 Width = 159 Height = 126}
如何??为什么??左上角是错误的,但宽度和高度没问题