InkAnalyzer.GetStrokeType 方法

返回 Stroke 的类型。

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

语法

声明
Public Function GetStrokeType ( _
    stroke As Stroke _
) As StrokeType
用法
Dim instance As InkAnalyzer
Dim stroke As Stroke
Dim returnValue As StrokeType

returnValue = instance.GetStrokeType(stroke)
public StrokeType GetStrokeType(
    Stroke stroke
)
public:
StrokeType GetStrokeType(
    Stroke^ stroke
)
public StrokeType GetStrokeType(
    Stroke stroke
)
public function GetStrokeType(
    stroke : Stroke
) : StrokeType

参数

返回值

类型:System.Windows.Ink.StrokeType
stroke 的分类。

备注

如果笔画的类型为 System.Windows.Ink.StrokeTypeUnspecified,则 InkAnalyzer 在墨迹分析过程中对笔画进行分类。否则,InkAnalyzer 使用在笔画上设置的类型。

若要指定或更改笔画类型,请使用 SetStrokeType() 或 SetStrokesType()。

示例

此示例定义 GetStrokeTypesInNode 方法,用于返回 ContextNode 中的所有笔画类型。

' Iterate through the strokes within the context node and add the
' stroke types to a collection.
Dim theStrokeTypes As New System.Collections.ArrayList()
Dim theStroke As Stroke
For Each theStroke In theContextNode.Strokes
    Dim theStrokeType As StrokeType = theInkAnalyzer.GetStrokeType(theStroke)
    If Not theStrokeTypes.Contains(theStrokeType) Then
        theStrokeTypes.Add(theStrokeType)
    End If
Next theStroke
// Iterate through the strokes within the context node and add the
// stroke types to a collection.
System.Collections.ArrayList theStrokeTypes =
    new System.Collections.ArrayList();
foreach (Stroke theStroke in theContextNode.Strokes)
{
    StrokeType theStrokeType =
        theInkAnalyzer.GetStrokeType(theStroke);
    if (!theStrokeTypes.Contains(theStrokeType))
    {
        theStrokeTypes.Add(theStrokeType);
    }
}

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkAnalyzer 类

InkAnalyzer 成员

System.Windows.Ink 命名空间

System.Windows.Ink.StrokeType