InkAnalyzer.AddStroke (Método) (Stroke, Int32)
Actualización: noviembre 2007
Agrega un trazo al objeto InkAnalyzer y asigna un identificador de configuración regional específico al trazo.
Espacio de nombres: Microsoft.Ink
Ensamblado: Microsoft.Ink.Analysis (en Microsoft.Ink.Analysis.dll)
Sintaxis
'Declaración
Public Function AddStroke ( _
strokeToAdd As Stroke, _
languageId As Integer _
) As ContextNode
'Uso
Dim instance As InkAnalyzer
Dim strokeToAdd As Stroke
Dim languageId As Integer
Dim returnValue As ContextNode
returnValue = instance.AddStroke(strokeToAdd, _
languageId)
public ContextNode AddStroke(
Stroke strokeToAdd,
int languageId
)
public:
ContextNode^ AddStroke(
Stroke^ strokeToAdd,
int languageId
)
public ContextNode AddStroke(
Stroke strokeToAdd,
int languageId
)
public function AddStroke(
strokeToAdd : Stroke,
languageId : int
) : ContextNode
Parámetros
- strokeToAdd
Tipo: Microsoft.Ink.Stroke
Objeto Stroke que se va a agregar al objeto InkAnalyzer.
- languageId
Tipo: System.Int32
Identificador de configuración regional que se va a asignar a strokeToAdd.
Valor devuelto
Tipo: Microsoft.Ink.ContextNode
Objeto ContextNode al que se agregó strokeToAdd.
Comentarios
El objeto InkAnalyzer agrega Stroke a un objeto UnclassifiedInkNode de la colección SubNodes de la propiedad RootNode. Al objeto Stroke, strokeToAdd, se le asigna el identificador de configuración regional languageId y se agrega al primer objeto UnclassifiedInkNode que contenga trazos con el mismo identificador de configuración regional. Si no existe este objeto UnclassifiedInkNode, se crea un nuevo objeto UnclassifiedInkNode y se agrega strokeToAdd al nuevo objeto UnclassifiedInkNode.
Este método expande la propiedad DirtyRegion a la unión del valor actual de la región y el cuadro de límite del trazo agregado.
Si el trazo ya está asociado al objeto InkAnalyzer, dicho objeto InkAnalyzer produce una excepción.
Ejemplos
Este ejemplo realiza lo siguiente.
Inicializa un nuevo objeto Microsoft.Ink.InkCollector, theInkCollector.
Asocia un controlador de eventos InkCollector.Stroke, theInkCollector_Stroke, a theInkCollector.
Inicializa un nuevo objeto InkAnalyzer, theInkAnalyzer, que puede analizar los datos de los trazos de la propiedad Ink del objeto InkCollector.
' Create and enable the InkCollector and attach event handlers.
Me.theInkCollector = New Microsoft.Ink.InkCollector(Me.theInkingPanel)
AddHandler Me.theInkCollector.Stroke, AddressOf Me.theInkCollector_Stroke
Me.theInkCollector.Enabled = True
' Create the InkAnalyzer.
Me.theInkAnalyzer = New Microsoft.Ink.InkAnalyzer(Me.theInkCollector.Ink, Me)
// Create and enable the InkCollector and attach event handlers.
this.theInkCollector =
new Microsoft.Ink.InkCollector(this.theInkingPanel);
this.theInkCollector.Stroke +=
new Microsoft.Ink.InkCollectorStrokeEventHandler(
this.theInkCollector_Stroke);
this.theInkCollector.Enabled = true;
// Create the InkAnalyzer.
this.theInkAnalyzer =
new Microsoft.Ink.InkAnalyzer(this.theInkCollector.Ink, this);
En este ejemplo, el controlador de eventos theInkCollector_Stroke toma a continuación el trazo que se ha agregado a theInkCollector, lo agrega a theInkAnalyzer y le asigna un identificador de configuración regional específico, theLanguageId.
''' <summary>
''' The ink collector's InkAdded event handler.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The event data.</param>
Sub theInkCollector_Stroke2( _
ByVal sender As Object, ByVal e As Microsoft.Ink.InkCollectorStrokeEventArgs)
' Add the new stroke to the InkAnalyzer using a specific language identifier.
Me.theInkAnalyzer.AddStroke(e.Stroke, Me.theLanguageId)
End Sub 'theInkCollector_Stroke2
/// <summary>
/// The ink collector's Stroke event handler.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
void theInkCollector_Stroke2(
object sender, Microsoft.Ink.InkCollectorStrokeEventArgs e)
{
// Add the new stroke to the InkAnalyzer using a specific
// language identifier.
this.theInkAnalyzer.AddStroke(e.Stroke, this.theLanguageId);
}
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