InkAnalyzer.GetStrokeType-Methode
Gibt den Typ eines Stroke zurück.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.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
Parameter
- stroke
Typ: Microsoft.Ink.Stroke
Der Strich, für den die Klassifizierung zurückgegeben werden soll.
Rückgabewert
Typ: Microsoft.Ink.StrokeType
Die Klassifizierung von stroke.
Hinweise
Wenn der Typ des Strichs der Microsoft.Ink.StrokeType-Wert Unspecified ist, klassifiziert der InkAnalyzer den Strich während der Freihandanalyse. Andernfalls verwendet InkAnalyzer den für den Strich festgelegten Typ.
Verwenden Sie zum Ändern des Strichtyps InkAnalyzer.SetStrokeType oder InkAnalyzer.SetStrokesType.
Beispiele
In diesem Beispiel wird eine Methode beschrieben, GetStrokeTypesInNode, mit der alle Typen von Strichen in einem ContextNode zurückgegeben werden können.
''' <summary>
''' Returns the locale identifiers for all the strokes in the node.
''' </summary>
''' <param name="theInkAnalyzer">The ink analyzer containing the node.</param>
''' <param name="theContextNode">The node to check.</param>
''' <returns>An array of unique locale identifiers.</returns>
Private Function GetStrokeTypesInNode( _
ByVal theInkAnalyzer As Microsoft.Ink.InkAnalyzer, _
ByVal theContextNode As Microsoft.Ink.ContextNode) _
As Microsoft.Ink.StrokeType()
' Iterate through the strokes within the context node and add the
' stroke types to a collection.
Dim theLanguages As New System.Collections.ArrayList()
Dim theStroke As Microsoft.Ink.Stroke
For Each theStroke In theContextNode.Strokes
Dim theStrokeType As Microsoft.Ink.StrokeType = _
theInkAnalyzer.GetStrokeType(theStroke)
If Not theLanguages.Contains(theStrokeType) Then
theLanguages.Add(theStrokeType)
End If
Next theStroke
' Return the elements of the collection as an array.
Return CType(theLanguages.ToArray(GetType(Microsoft.Ink.StrokeType)), _
Microsoft.Ink.StrokeType())
End Function 'GetStrokeTypesInNode
/// <summary>
/// Returns the locale identifiers for all the strokes in the node.
/// </summary>
/// <param name="theInkAnalyzer">The ink analyzer containing the node.</param>
/// <param name="theContextNode">The node to check.</param>
/// <returns>An array of unique locale identifiers.</returns>
private Microsoft.Ink.StrokeType[] GetStrokeTypesInNode(
Microsoft.Ink.InkAnalyzer theInkAnalyzer,
Microsoft.Ink.ContextNode theContextNode)
{
// Iterate through the strokes within the context node and add the
// stroke types to a collection.
System.Collections.ArrayList theLanguages =
new System.Collections.ArrayList();
foreach (Microsoft.Ink.Stroke theStroke in theContextNode.Strokes)
{
Microsoft.Ink.StrokeType theStrokeType =
theInkAnalyzer.GetStrokeType(theStroke);
if (!theLanguages.Contains(theStrokeType))
{
theLanguages.Add(theStrokeType);
}
}
// Return the elements of the collection as an array.
return (Microsoft.Ink.StrokeType[])
(theLanguages.ToArray(typeof(Microsoft.Ink.StrokeType)));
}
Plattformen
Windows Vista
.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.
Versionsinformationen
.NET Framework
Unterstützt in: 3.0