Edit

Share via


CGRect.Union(CGRect, CGRect) Method

Definition

Gets a CGRect structure that contains the union of two CGRect structures.

public static CoreGraphics.CGRect Union(CoreGraphics.CGRect a, CoreGraphics.CGRect b);
static member Union : CoreGraphics.CGRect * CoreGraphics.CGRect -> CoreGraphics.CGRect

Parameters

a
CGRect

<attribution license="cc4" from="Microsoft" modified="false"></attribution>A rectangle to union.

b
CGRect

<attribution license="cc4" from="Microsoft" modified="false"></attribution>A rectangle to union.

Returns

<attribution license="cc4" from="Microsoft" modified="false"></attribution>

A CGRect structure that bounds the union of the two CGRect structures.

Remarks

<attribution license="cc4" from="Microsoft" modified="false"></attribution>

When one of the two rectangles is empty, meaning all of its values are zero, the Union(CGRect, CGRect) method returns a rectangle with a starting point of (0, 0), and the height and width of the non-empty rectangle. For example, if you have two rectangles: A = (0, 0; 0, 0) and B = (1, 1; 2, 2), then the union of A and B is (0, 0; 2, 2).

Applies to