次の方法で共有


InkWordNode クラス

論理グループを構成して認識可能な単語を形成するストロークのコレクションの ContextNode を表します。

名前空間 :  System.Windows.Ink
アセンブリ :  IAWinFX (IAWinFX.dll 内)

構文

'宣言
Public NotInheritable Class InkWordNode _
    Inherits ContextNode
'使用
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

解説

InkWordNode オブジェクトには、子を含めることができません。

次の例では、InkAnalyzer、theInkAnalyzer のすべての InkWordNode オブジェクトをループし、回転された外接する四角形、アセンダ ライン ascenderLine、デセンダ ライン descenderLine、中線、およびベースラインを示す線を描画します。この線は、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);
}

継承階層

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

スレッド セーフ

この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

Windows Vista

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

InkWordNode メンバ

System.Windows.Ink 名前空間