AnalysisRegion.Exclude 方法 (Rect)
将此 AnalysisRegion 的区域限制为其区域与指定矩形不相交的部分。
命名空间: System.Windows.Ink
程序集: IAWinFX(在 IAWinFX.dll 中)
语法
声明
Public Sub Exclude ( _
rectangleToExclude As Rect _
)
用法
Dim instance As AnalysisRegion
Dim rectangleToExclude As Rect
instance.Exclude(rectangleToExclude)
public void Exclude(
Rect rectangleToExclude
)
public:
void Exclude(
Rect rectangleToExclude
)
public void Exclude(
Rect rectangleToExclude
)
public function Exclude(
rectangleToExclude : Rect
)
参数
- rectangleToExclude
类型:System.Windows.Rect
要排除的区域。
备注
如果两个区域不相交,则此 AnalysisRegion 不变。
如果 rectangleToExclude 在 MinXY 和 MaxXY 所定义的边界之外,则 Exclude 方法会引发 ArgumentOutOfRangeException。
示例
此示例创建两个 AnalysisRegion 对象。它使用 Intersect、Union 和 Exclude 方法来修改这两个对象的区域。
' 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