Freigeben über


AnalysisRegion.Intersect-Methode (Rect)

Schränkt die aktuelle AnalysisRegion auf einen Bereich ein, der sowohl den Bereich als auch das angegebene Rechteck schneidet.

Namespace:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.dll)

Syntax

'Declaration
Public Sub Intersect ( _
    rectangle As Rect _
)
'Usage
Dim instance As AnalysisRegion
Dim rectangle As Rect

instance.Intersect(rectangle)
public void Intersect(
    Rect rectangle
)
public:
void Intersect(
    Rect rectangle
)
public void Intersect(
    Rect rectangle
)
public function Intersect(
    rectangle : Rect
)

Parameter

  • rectangle
    Typ: System.Windows.Rect
    Das Rechteck, mit dem eine Schnittmenge in Freihandbereichskoordinaten gebildet werden soll.

Hinweise

Wenn sich die beiden Bereiche nicht überschneiden, ist der neue Bereich leer.

Die Intersect-Methode löst einen ArgumentOutOfRangeException-Fehler aus, wenn rectangle Begrenzungen außerhalb von MinXY und MaxXY aufweist.

Beispiele

In diesem Beispiel werden zwei AnalysisRegion-Objekte erstellt. Es werden die Methoden Intersect, Union und Exclude zum Ändern der Bereiche des Objekts verwendet.

' Create an infinite AnalysisRegion.
Dim theFirstAnalysisRegion As New AnalysisRegion()
' Create a finite AnalysisRegion.
Dim theSecondAnalysisRegion As New AnalysisRegion(New Rect(100, 100, 200, 200))
' 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 Rect(100, 100, 200, 200))

' 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 Rect(100, 100, 200, 200))

' 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 Rect(100, 100, 200, 200))
// Create an infinite AnalysisRegion.
AnalysisRegion theFirstAnalysisRegion =
    new AnalysisRegion();

// Create a finite AnalysisRegion.
AnalysisRegion theSecondAnalysisRegion =
    new AnalysisRegion(
        new Rect(100, 100, 200, 200));

// 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 Rect(100, 100, 200, 200));

// 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 Rect(100, 100, 200, 200));

// 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 Rect(100, 100, 200, 200));

Plattformen

Windows Vista

.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

Versionsinformationen

.NET Framework

Unterstützt in: 3.0

Siehe auch

Referenz

AnalysisRegion-Klasse

AnalysisRegion-Member

Intersect-Überladung

System.Windows.Ink-Namespace

AnalysisRegion.GetBounds

AnalysisRegion.Exclude

AnalysisRegion.Union