次の方法で共有


InkAnalyzer.GetTextRangeFromNodes メソッド

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

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

構文

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

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

パラメータ

  • start
    型 : System.Int32%
    このメソッドが返されるとき、start パラメータにはテキスト範囲の開始点を示す 32 ビット符号付き整数が含まれます。このパラメータは初期化されないまま渡されます。
  • length
    型 : System.Int32%
    このメソッドが返されるとき、length パラメータにはテキスト範囲の長さを示す 32 ビット符号付き整数が含まれます。このパラメータは初期化されないまま渡されます。

解説

nodesToSearch に、互いに隣接していない ContextNode オブジェクトが含まれる場合、このメソッドは、すべての ContextNode オブジェクトが含まれる最小のテキスト範囲を返します。

InkAnalyzer に関連付けられていない ContextNode が nodesToSearch に含まれる場合、このメソッドは ArgumentException をスローします。

この例では、(theResultsTextBox という名前の) TextBox のテキストを、(theInkAnalyzer という名前の) InkAnalyzer の認識文字列に設定する SelectTextRangeFromNodes という名前のメソッドを定義します。次に、パラメータ theContextNodes の認識されたテキストに範囲が及ぶようにテキスト ボックス選択を設定します。

Private Sub SelectTextRangeFromNodes(ByVal theContextNodes As ContextNodeCollection) 

    ' Set the text of theResultsTextBox.
    Me.theResultsTextBox.Text = Me.theInkAnalyzer.GetRecognizedString()

    ' Get the text range for theContextNodes.
    Dim theStart As Integer
    Dim theLength As Integer

    Me.theInkAnalyzer.GetTextRangeFromNodes(theContextNodes, theStart, theLength)

    ' Select the text range in the TextBox.
    Me.theResultsTextBox.Select(theStart, theLength)

End Sub 'SelectTextRangeFromNodes
private void SelectTextRangeFromNodes(ContextNodeCollection theContextNodes)
{
    // Set the text of theResultsTextBox.
    this.theResultsTextBox.Text = this.theInkAnalyzer.GetRecognizedString();

    // Get the text range for theContextNodes.
    int theStart;
    int theLength;

    this.theInkAnalyzer.GetTextRangeFromNodes(
        theContextNodes, out theStart, out theLength);

    // Select the text range in the TextBox.
    this.theResultsTextBox.Select(theStart, theLength);
}

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

InkAnalyzer クラス

InkAnalyzer メンバ

System.Windows.Ink 名前空間