Partager via


InkWordNode, classe

Mise à jour : November 2007

Représente un ContextNode pour une collection de traits qui constituent un regroupement logique qui forme un mot reconnaissable.

Espace de noms :  System.Windows.Ink
Assembly :  IAWinFX (dans IAWinFX.dll)

Syntaxe

'Déclaration
Public NotInheritable Class InkWordNode _
    Inherits ContextNode
'Utilisation
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

Notes

Un objet InkWordNode ne peut pas contenir d'enfants.

Exemples

L'exemple suivant parcourt en boucle tous les objets InkWordNode d'un InkAnalyzer, theInkAnalyzer, puis dessine des lignes qui affichent le rectangle englobant pivoté, la ligne des ascendantes, ascenderLine, la ligne des descendantes, descenderLine, la médiane et la ligne de base. Les lignes sont dessinées sur un InkCanvas, theInkCanvas.

' Loop through all of the ink words
Dim inkWords As ContextNodeCollection = _
    theInkAnalyzer.FindNodesOfType(ContextNodeType.InkWord)
Dim inkWord As InkWordNode

For Each inkWord In inkWords
    ' Show rotated bounding box in blue
    Dim rotatedBounds As New Polygon()

    rotatedBounds.Points = inkWord.GetRotatedBoundingBox()
    rotatedBounds.Stroke = Brushes.Blue

    Me.theInkCanvas.Children.Add(rotatedBounds)
    ' Show the ascender line in green
    Dim ascenderLine As New Polyline()

    ascenderLine.Points = inkWord.GetAscender()
    ascenderLine.Stroke = Brushes.Green

    Me.theInkCanvas.Children.Add(ascenderLine)
    ' Show the baseline in purple
    Dim baseline As New Polyline()

    baseline.Points = inkWord.GetBaseline()
    baseline.Stroke = Brushes.Purple

    theInkCanvas.Children.Add(baseline)
    ' Show the descender line in yellow
    Dim descenderLine As New Polyline()

    descenderLine.Points = inkWord.GetDescender()
    descenderLine.Stroke = Brushes.Yellow

    theInkCanvas.Children.Add(descenderLine)
    ' Show the descender line in brown
    Dim midline As New Polyline()

    midline.Points = inkWord.GetMidline()
    midline.Stroke = Brushes.Brown

    theInkCanvas.Children.Add(midline)
Next inkWord
// Loop through all of the ink words
ContextNodeCollection inkWords =
    theInkAnalyzer.FindNodesOfType(ContextNodeType.InkWord);
foreach (InkWordNode inkWord in inkWords)
{
    // Show rotated bounding box in blue
    Polygon rotatedBounds = new Polygon();

    rotatedBounds.Points = inkWord.GetRotatedBoundingBox();
    rotatedBounds.Stroke = Brushes.Blue;

    this.theInkCanvas.Children.Add(rotatedBounds);


    // Show the ascender line in green
    Polyline ascenderLine = new Polyline();

    ascenderLine.Points = inkWord.GetAscender();
    ascenderLine.Stroke = Brushes.Green;

    this.theInkCanvas.Children.Add(ascenderLine);

    // Show the baseline in purple
    Polyline baseline = new Polyline();

    baseline.Points = inkWord.GetBaseline();
    baseline.Stroke = Brushes.Purple;

    theInkCanvas.Children.Add(baseline);

    // Show the descender line in yellow
    Polyline descenderLine = new Polyline();

    descenderLine.Points = inkWord.GetDescender();
    descenderLine.Stroke = Brushes.Yellow;

    theInkCanvas.Children.Add(descenderLine);   

    // Show the midline in brown
    Polyline midline = new Polyline();

    midline.Points = inkWord.GetMidline();
    midline.Stroke = Brushes.Brown;

    theInkCanvas.Children.Add(midline);
}

Hiérarchie d'héritage

System.Object
  System.Windows.Ink.ContextNode
    System.Windows.Ink.InkWordNode

Sécurité des threads

Tous les membres static (Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Plateformes

Windows Vista

Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.

Informations de version

.NET Framework

Pris en charge dans : 3.0

Voir aussi

Référence

Membres InkWordNode

System.Windows.Ink, espace de noms