RectangleExtensionsIntersectSafe Method

Like Intersect(Rectangle, Rectangle), but works with big ranges, and returns Empty if the result would be a practically zero rectangle. As a contrast, the Intersect(Rectangle, Rectangle) method can return a non-Empty rectangle with zero Width or Height.

Definition

Namespace: KGySoft.WinForms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public static Rectangle IntersectSafe(
	this Rectangle a,
	Rectangle b
)

Parameters

a  Rectangle
The first rectangle to intersect.
b  Rectangle
The second rectangle to intersect.

Return Value

Rectangle
A Rectangle that represents the intersection of a and b.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Rectangle. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also