InkAnalyzer.GetStrokeType (Método)
Actualización: noviembre 2007
Devuelve el tipo de un objeto Stroke.
Espacio de nombres: Microsoft.Ink
Ensamblado: Microsoft.Ink.Analysis (en Microsoft.Ink.Analysis.dll)
Sintaxis
'Declaración
Public Function GetStrokeType ( _
stroke As Stroke _
) As StrokeType
'Uso
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
Parámetros
- stroke
Tipo: Microsoft.Ink.Stroke
El trazo para el que se va a devolver la clasificación.
Valor devuelto
Tipo: Microsoft.Ink.StrokeType
Clasificación de stroke.
Comentarios
Si el tipo del trazo es el valor Unspecified del objeto Microsoft.Ink.StrokeType, el objeto InkAnalyzer clasifica el trazo durante el análisis de la entrada manuscrita. En caso contrario, el objeto InkAnalyzer utiliza el tipo establecido en el trazo.
Para especificar o cambiar el tipo de trazo, utilice el método InkAnalyzer.SetStrokeType o InkAnalyzer.SetStrokesType.
Ejemplos
En este ejemplo se define un método, GetStrokeTypesInNode, para devolver todos los tipos de trazos de un objeto ContextNode.
''' <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)));
}
Plataformas
Windows Vista
.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Información de versión
.NET Framework
Compatible con: 3.0