Freigeben über


AnalysisRegion.Union Method (AnalysisRegion)

Expands the area of this AnalysisRegion to the area created by its union with the specified AnalysisRegion.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in microsoft.ink.analysis.dll)

Syntax

'Declaration
Public Sub Union ( _
    regionToUnion As AnalysisRegion _
)
'Usage
Dim instance As AnalysisRegion
Dim regionToUnion As AnalysisRegion

instance.Union(regionToUnion)
public void Union (
    AnalysisRegion regionToUnion
)
public:
void Union (
    AnalysisRegion^ regionToUnion
)
public void Union (
    AnalysisRegion regionToUnion
)
public function Union (
    regionToUnion : AnalysisRegion
)
Not applicable.

Parameters

Remarks

If either area is infinite, the new area is also infinite.

Example

This example creates two AnalysisRegion objects. It uses the Intersect, Union, and Exclude methods to modify the objects' areas.

' Create an infinite AnalysisRegion.
Dim theFirstAnalysisRegion As New Microsoft.Ink.AnalysisRegion()

' Create a finite AnalysisRegion.
Dim theSecondAnalysisRegion As New Microsoft.Ink.AnalysisRegion( _
    New System.Drawing.Rectangle(205, 205, 2054, 1027))

' Extend an AnalysisRegion using the Union method and an AnalysisRegion.
theFirstAnalysisRegion.Union(theSecondAnalysisRegion)

' Extend an AnalysisRegion using the Union method and a rectangle.
theFirstAnalysisRegion.Union(New Rectangle(0, 2054, 2054, 1027))

' Restrict an AnalysisRegion using the Intersect method and an AnalysisRegion.
theFirstAnalysisRegion.Intersect(theSecondAnalysisRegion)

' Restrict an AnalysisRegion using the Intersect method and a rectangle.
theFirstAnalysisRegion.Intersect(New Rectangle(750, 1000, 2500, 1500))

' Modify an AnalysisRegion using the Exclude method and an AnalysisRegion.
theFirstAnalysisRegion.Exclude(theSecondAnalysisRegion)

' Modify an AnalysisRegion using the Exclude method and a rectangle.
theFirstAnalysisRegion.Exclude(New Rectangle(750, 1000, 500, 500))
// Create an infinite AnalysisRegion.
Microsoft.Ink.AnalysisRegion theFirstAnalysisRegion =
    new Microsoft.Ink.AnalysisRegion();

// Create a finite AnalysisRegion.
Microsoft.Ink.AnalysisRegion theSecondAnalysisRegion =
    new Microsoft.Ink.AnalysisRegion(
        new System.Drawing.Rectangle(205, 205, 2054, 1027));

// Extend an AnalysisRegion using the Union method and an AnalysisRegion.
theFirstAnalysisRegion.Union(theSecondAnalysisRegion);

// Extend an AnalysisRegion using the Union method and a rectangle.
theFirstAnalysisRegion.Union(new Rectangle(0, 2054, 2054, 1027));

// Restrict an AnalysisRegion using the Intersect method and an AnalysisRegion.
theFirstAnalysisRegion.Intersect(theSecondAnalysisRegion);

// Restrict an AnalysisRegion using the Intersect method and a rectangle.
theFirstAnalysisRegion.Intersect(new Rectangle(750, 1000, 2500, 1500));

// Modify an AnalysisRegion using the Exclude method and an AnalysisRegion.
theFirstAnalysisRegion.Exclude(theSecondAnalysisRegion);

// Modify an AnalysisRegion using the Exclude method and a rectangle.
theFirstAnalysisRegion.Exclude(new Rectangle(750, 1000, 500, 500));

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

AnalysisRegion Class
AnalysisRegion Members
Microsoft.Ink Namespace
AnalysisRegion.GetBounds
Microsoft.Ink.AnalysisRegion.Exclude
Microsoft.Ink.AnalysisRegion.Intersect