Share via


InkAnalyzer.GetStrokeType Method

Returns the type of a Stroke.

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

Syntax

'Declaration
Public Function GetStrokeType ( _
    stroke As Stroke _
) As StrokeType
'Usage
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 function GetStrokeType(
    stroke : Stroke
) : StrokeType

Parameters

Return Value

Type: System.Windows.Ink.StrokeType
The classification of stroke.

Remarks

If the stroke's type is the System.Windows.Ink.StrokeType value Unspecified, the InkAnalyzer classifies the stroke during ink analysis. Otherwise, the InkAnalyzer uses the type set on the stroke.

To specify or change the stroke type, use SetStrokeType or SetStrokesType.

Examples

This example defines a method, GetStrokeTypesInNode, for returning all stroke types in a 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);
    }
}

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzer Class

InkAnalyzer Members

System.Windows.Ink Namespace

System.Windows.Ink.StrokeType