Partager 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 StrokeType GetStrokeType (
    Stroke stroke
)
public function GetStrokeType (
    stroke : Stroke
) : StrokeType
Not applicable.

Parameters

  • stroke
    The stroke for which to return the classification.

Return Value

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.

Example

This example defines a method, GetStrokeTypesInNode, for returning all the types for the strokes 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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzer Class
InkAnalyzer Members
System.Windows.Ink Namespace
System.Windows.Ink.StrokeType