InkAnalyzer.RemoveStroke 方法

从墨迹分析器移除 Stroke

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

语法

声明
Public Sub RemoveStroke ( _
    strokeToRemove As Stroke _
)
用法
Dim instance As InkAnalyzer
Dim strokeToRemove As Stroke

instance.RemoveStroke(strokeToRemove)
public void RemoveStroke(
    Stroke strokeToRemove
)
public:
void RemoveStroke(
    Stroke^ strokeToRemove
)
public void RemoveStroke(
    Stroke strokeToRemove
)
public function RemoveStroke(
    strokeToRemove : Stroke
)

参数

备注

RemoveStroke 从 InkAnalyzer 移除 strokeToRemove。

此方法从引用 strokeToRemove 的叶上下文节点移除该笔画。如果该上下文节点不再引用任何笔画,则此方法删除该上下文节点以及不再拥有子节点的所有上级节点。

从上下文节点移除笔画后,此方法更新 DirtyRegion 以包含已移除笔画的边界框。

如果该笔画不与墨迹分析器相关联,则此方法返回但不更新墨迹分析器。

如果 strokeToRemove 为 nullnull 引用(在 Visual Basic 中为 Nothing),则此方法引发 ArgumentNullException

示例

此示例确定 Stroke (theStroke) 的边界框的左边界是否小于名为 leftBound 的 32 位有符号整数。如果是,则从名为 theInkAnalyzer 的 InkAnalyzer 移除 theStroke。

' Remove the stroke if its bounding box falls outside of the left bound.
If Not (theStroke Is Nothing) AndAlso theStroke.GetBounds().Left < leftBound Then
    Me.theInkAnalyzer.RemoveStroke(theStroke)
End If
// Remove the stroke if its bounding box falls outside of the left bound.
if (theStroke != null && theStroke.GetBounds().Left < leftBound)
{
    this.theInkAnalyzer.RemoveStroke(theStroke);
}

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkAnalyzer 类

InkAnalyzer 成员

System.Windows.Ink 命名空间

InkAnalyzer.AddStroke

InkAnalyzer.AddStrokes

InkAnalyzerRemoveStrokes()

InkAnalyzer.DirtyRegion