次の方法で共有


ParagraphNode.GetTextRangeFromNodes メソッド

ParagraphNode の子孫である ContextNode オブジェクトのコレクションに対応する認識された文字列内のテキスト範囲を検索します。

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

構文

'宣言
Public Sub GetTextRangeFromNodes ( _
    subTree As ContextNodeCollection, _
    <OutAttribute> ByRef start As Integer, _
    <OutAttribute> ByRef length As Integer _
)
'使用
Dim instance As ParagraphNode
Dim subTree As ContextNodeCollection
Dim start As Integer
Dim length As Integer

instance.GetTextRangeFromNodes(subTree, _
    start, length)
public void GetTextRangeFromNodes(
    ContextNodeCollection subTree,
    out int start,
    out int length
)
public:
void GetTextRangeFromNodes(
    ContextNodeCollection^ subTree, 
    [OutAttribute] int% start, 
    [OutAttribute] int% length
)
public void GetTextRangeFromNodes(
    ContextNodeCollection subTree,
    /** @attribute OutAttribute */ /** @ref */int start,
    /** @attribute OutAttribute */ /** @ref */int length
)
public function GetTextRangeFromNodes(
    subTree : ContextNodeCollection, 
    start : int, 
    length : int
)

パラメータ

  • start
    型 : System.Int32%
    テキスト範囲の開始点。

解説

subTree パラメータに、ParagraphNode の子孫ではない ContextNode オブジェクトが含まれている場合、ArgumentException がスローされます。

subTree パラメータに、連続していない ContextNode オブジェクトが含まれる場合、すべての ContextNode オブジェクトが含まれる最小のテキスト範囲が返されます。

次の例では、ParagraphNode、paragraph を使用して、最後の行を検索します。次に、この行に対応するテキスト範囲を検索して GetRecognizedString の値を TextBox、selectedResultsTextBox に設定し、最後の行に対応するテキストを選択します。

Dim nLines As Integer = paragraph.SubNodes.Count
Dim lastLine As LineNode = CType(paragraph.SubNodes(nLines - 1), LineNode)

' Create a collection to hold this line
Dim lastLineCollection As New ContextNodeCollection(theInkAnalyzer)
lastLineCollection.Add(lastLine)

' Find corresponding start and length
Dim start, length As Integer
paragraph.GetTextRangeFromNodes(lastLineCollection, start, length)

' Select this in the text box
selectedResultsTextBox.Text = paragraph.GetRecognizedString()
selectedResultsTextBox.Select(start, length)
int nLines = paragraph.SubNodes.Count;
LineNode lastLine = (LineNode)paragraph.SubNodes[nLines - 1];

// Create a collection to hold this line
ContextNodeCollection lastLineCollection = new ContextNodeCollection(theInkAnalyzer);
lastLineCollection.Add(lastLine);

// Find corresponding start and length
int start, length;
paragraph.GetTextRangeFromNodes(lastLineCollection, out start, out length);

// Select this in the text box
selectedResultsTextBox.Text = paragraph.GetRecognizedString();
selectedResultsTextBox.Select(start, length);

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

ParagraphNode クラス

ParagraphNode メンバ

System.Windows.Ink 名前空間