InkWordNode (Clase)
Actualización: noviembre 2007
Representa un objeto ContextNode de una colección de trazos que constituyen una agrupación lógica para formar una palabra reconocible.
Espacio de nombres: Microsoft.Ink
Ensamblado: Microsoft.Ink.Analysis (en Microsoft.Ink.Analysis.dll)
Sintaxis
'Declaración
Public NotInheritable Class InkWordNode _
Inherits ContextNode
'Uso
Dim instance As InkWordNode
public sealed class InkWordNode : ContextNode
public ref class InkWordNode sealed : public ContextNode
public final class InkWordNode extends ContextNode
public final class InkWordNode extends ContextNode
Comentarios
Un objeto InkWordNode no puede contener ningún elemento secundario.
Ejemplos
En el ejemplo siguiente, se recorren en bucle todos los objetos InkWordNode de InkAnalyzer, theInkAnalyzer, y después se dibujan líneas que muestran el rectángulo delimitador girado, la línea ascendente, la línea descendente, la línea media y la línea base. Las líneas se dibujan en un objeto PaneltheNotesPanel.
Dim panelGraphics As Graphics = theNotesPanel.CreateGraphics()
Dim theRenderer As Renderer = theInkCollector.Renderer
' Loop through all of the ink words
Dim inkWords As ContextNodeCollection = _
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord)
Dim inkWord As InkWordNode
For Each inkWord In inkWords
' Show rotated bounding box in blue
' Convert corners to pixel coordinates
Dim corners As Point() = inkWord.GetRotatedBoundingBox()
theRenderer.InkSpaceToPixel(panelGraphics, corners)
' Draw the rectangle
panelGraphics.DrawPolygon(New Pen(Color.Blue), corners)
' Show the ascender line in green
Dim ascenderPoints As Point() = inkWord.GetAscender()
' Convert to pixel coordinates
theRenderer.InkSpaceToPixel(panelGraphics, ascenderPoints)
panelGraphics.DrawLines(New Pen(Color.Green), ascenderPoints)
' Show the baseline in purple
Dim basePoints As Point() = inkWord.GetBaseline()
' Convert to pixel coordinates
theRenderer.InkSpaceToPixel(panelGraphics, basePoints)
panelGraphics.DrawLines(New Pen(Color.Purple), basePoints)
' Show the descender line in yellow
Dim descenderPoints As Point() = inkWord.GetDescender()
' Convert to pixel coordinates
theRenderer.InkSpaceToPixel(panelGraphics, descenderPoints)
panelGraphics.DrawLines(New Pen(Color.Yellow), descenderPoints)
' Show the mid line in brown
Dim midlinePoints As Point() = inkWord.GetMidline()
' Convert to pixel coordinates
theRenderer.InkSpaceToPixel(panelGraphics, midlinePoints)
panelGraphics.DrawLines(New Pen(Color.Brown), midlinePoints)
Next inkWord
panelGraphics.Dispose()
End Sub 'inkWordMenuItem_Click
Graphics panelGraphics = theNotesPanel.CreateGraphics();
Renderer theRenderer = theInkCollector.Renderer;
// Loop through all of the ink words
ContextNodeCollection inkWords =
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord);
foreach (InkWordNode inkWord in inkWords)
{
// Show rotated bounding box in blue
// Convert corners to pixel coordinates
Point[] corners = inkWord.GetRotatedBoundingBox();
theRenderer.InkSpaceToPixel(panelGraphics, ref corners);
// Draw the rectangle
panelGraphics.DrawPolygon(new Pen(Color.Blue), corners);
// Show the ascender line in green
Point[] ascenderPoints = inkWord.GetAscender();
// Convert to pixel coordinates
theRenderer.InkSpaceToPixel(panelGraphics, ref ascenderPoints);
panelGraphics.DrawLines(new Pen(Color.Green), ascenderPoints);
// Show the baseline in purple
Point[] basePoints = inkWord.GetBaseline();
// Convert to pixel coordinates
theRenderer.InkSpaceToPixel(panelGraphics, ref basePoints);
panelGraphics.DrawLines(new Pen(Color.Purple), basePoints);
// Show the descender line in yellow
Point[] descenderPoints = inkWord.GetDescender();
// Convert to pixel coordinates
theRenderer.InkSpaceToPixel(panelGraphics, ref descenderPoints);
panelGraphics.DrawLines(new Pen(Color.Yellow), descenderPoints);
// Show the mid line in brown
Point[] midlinePoints = inkWord.GetMidline();
// Convert to pixel coordinates
theRenderer.InkSpaceToPixel(panelGraphics, ref midlinePoints);
panelGraphics.DrawLines(new Pen(Color.Brown), midlinePoints);
}
panelGraphics.Dispose();
Jerarquía de herencia
System.Object
Microsoft.Ink.ContextNode
Microsoft.Ink.InkWordNode
Seguridad para subprocesos
Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.
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