Rectangle.Intersect

Intersect(Rectangle, Rectangle)

Returns a third Rectangle structure that represents the intersection of two other Rectangle structures. If there is no intersection, an empty Rectangle is returned.

public static Rectangle Intersect(Rectangle a, Rectangle b)
ParameterTypeDescription
aRectangleFirst rectangle to intersect.
bRectangleSecond rectangle to intersect.

Return Value

A Rectangle that represents the intersection of a and b.

See Also


Intersect(Rectangle)

Replaces this Rectangle with the intersection of itself and the specified Rectangle.

public void Intersect(Rectangle rect)
ParameterTypeDescription
rectRectangleThe Rectangle with which to intersect.

See Also