AnalysisRegion.Intersect 方法 (Rect)

将当前 AnalysisRegion 限制为与此区域和指定的矩形二者都相交的区域。

命名空间:  System.Windows.Ink
程序集:  IAWinFX(在 IAWinFX.dll 中)

语法

声明
Public Sub Intersect ( _
    rectangle As Rect _
)
用法
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
)

参数

  • rectangle
    类型:System.Windows.Rect
    要与之相交的矩形(以墨迹空间坐标表示)。

备注

如果两个区域不相交,则新区域为空。

如果 rectangle 的边界在 MinXYMaxXY 之外,则 Intersect 方法会引发 ArgumentOutOfRangeException

示例

此示例创建两个 AnalysisRegion 对象。它使用 IntersectUnionExclude 方法来修改这两个对象的区域。

' 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));

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

AnalysisRegion 类

AnalysisRegion 成员

Intersect 重载

System.Windows.Ink 命名空间

AnalysisRegion.GetBounds

AnalysisRegion.Exclude

AnalysisRegion.Union