Condividi tramite


Classe InkWordNode

Aggiornamento: novembre 2007

Rappresenta un oggetto ContextNode per un insieme di tratti che costituisce un raggruppamento logico che forma una parola riconoscibile.

Spazio dei nomi:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.dll)

Sintassi

'Dichiarazione
Public NotInheritable Class InkWordNode _
    Inherits ContextNode
'Utilizzo
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

Note

Un oggetto InkWordNode non può contenere elementi figlio.

Esempi

Nell'esempio seguente vengono riprodotti in ciclo continuo tutti gli oggetti InkWordNode di un oggetto InkAnalyzer, theInkAnalyzer, quindi vengono disegnate le linee che mostrano il rettangolo di delimitazione ruotato, la linea ascendente (ascenderLine), la linea discendente (descenderLine), la linea mediana e la linea di base. Le linee vengono disegnate in un oggetto 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);
}

Gerarchia di ereditarietà

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

Codice thread safe

Qualsiasi membro static (Shared in Visual Basic) pubblico di questo tipo è thread-safe. I membri di istanza non sono garantiti come thread-safe.

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

Membri InkWordNode

Spazio dei nomi System.Windows.Ink