次の方法で共有


TextWordNode クラス

アプリケーション内のインク以外のテキスト単語が存在可能な 2 次元領域の ContextNode を表します。

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

構文

'宣言
Public NotInheritable Class TextWordNode _
    Inherits ContextNode
'使用
Dim instance As TextWordNode
public sealed class TextWordNode : ContextNode
public ref class TextWordNode sealed : public ContextNode
public final class TextWordNode extends ContextNode
public final class TextWordNode extends ContextNode

解説

InkAnalyzer は TextWordNode オブジェクトを生成しません。アプリケーションは、CreateSubNode(ContextNodeType) メソッドを使用して TextWordNode オブジェクトをコンテキスト ノード ツリーに追加します。アナライザの状態が保持される場合、これらのノードも同様に保持できます。

将来的には、認識エンジンは TextWordNode オブジェクトにより定義された領域を使用して、インク以外の単語に注釈を作成しているインクがあるかどうかを調べることができます。

TextWordNode には、子ノードを含めることができません。

次の例では、theTextBox という名前の TextBox コントロールで theInkAnalyzer という名前の InkAnalyzer に TextWordNode オブジェクトを追加します。また、TextBoxText プロパティに TextWordNode オブジェクトの Data プロパティを設定します。

' Add nodes to hold the TextWordNode
Dim writingRegion As WritingRegionNode = _
    CType(theInkAnalyzer.RootNode.CreateSubNode(ContextNodeType.WritingRegion), _
    WritingRegionNode)

Dim paragraph As ParagraphNode = _
    CType(writingRegion.CreateSubNode(ContextNodeType.Paragraph), _
    ParagraphNode)

Dim line As LineNode = _
    CType(paragraph.CreateSubNode(ContextNodeType.Line), LineNode)

' Create node for the word
Dim textWord As TextWordNode = _
    CType(line.CreateSubNode(ContextNodeType.TextWord), TextWordNode)

' Set ___location
Dim textTop As Double = InkCanvas.GetTop(theTextBox)
Dim textLeft As Double = InkCanvas.GetLeft(theTextBox)

Dim rectLocation As New Rect(textLeft, textTop, theTextBox.Width, theTextBox.Height)
textWord.SetLocation(New AnalysisRegion(rectLocation))

' Set the data property to be the text in the textbox.
textWord.Data = theTextBox.Text

// Add nodes to hold the TextWordNode
WritingRegionNode writingRegion = (WritingRegionNode)
    theInkAnalyzer.RootNode.CreateSubNode(ContextNodeType.WritingRegion);
ParagraphNode paragraph = (ParagraphNode)
    writingRegion.CreateSubNode(ContextNodeType.Paragraph);
LineNode line = (LineNode)
    paragraph.CreateSubNode(ContextNodeType.Line);

// Create node for the word
TextWordNode textWord = (TextWordNode)
    line.CreateSubNode(ContextNodeType.TextWord);


// Set ___location
double textTop = InkCanvas.GetTop(theTextBox);
double textLeft = InkCanvas.GetLeft(theTextBox);

Rect rectLocation = new Rect(textLeft, textTop, theTextBox.Width, theTextBox.Height);
textWord.SetLocation(new AnalysisRegion(rectLocation));

// Set the data property to be the text in the textbox.
textWord.Data = theTextBox.Text;

継承階層

System.Object
  System.Windows.Ink.ContextNode
    System.Windows.Ink.TextWordNode

スレッド セーフ

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

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

TextWordNode メンバ

System.Windows.Ink 名前空間

System.Windows.Ink.InkWordNode

System.Windows.Ink.ImageNode