次の方法で共有


CustomRecognizerNode.InkRecognitionConfidence プロパティ

認識結果の正確さに関して InkAnalyzer によって出力される信頼性レベルの値を返します。

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

構文

'宣言
Public ReadOnly Property InkRecognitionConfidence As InkRecognitionConfidence
'使用
Dim instance As CustomRecognizerNode
Dim value As InkRecognitionConfidence

value = instance.InkRecognitionConfidence
public InkRecognitionConfidence InkRecognitionConfidence { get; }
public:
property InkRecognitionConfidence InkRecognitionConfidence {
    InkRecognitionConfidence get ();
}
/** @property */
public InkRecognitionConfidence get_InkRecognitionConfidence()
public function get InkRecognitionConfidence () : InkRecognitionConfidence

プロパティ値

型 : System.Windows.Ink.InkRecognitionConfidence
認識結果の正確さに関して InkAnalyzer によって出力される信頼性レベルの値。

次の例では、selectedResultsTextBox という名前の TextBox を使用します。Text プロパティは既に、customRecognizer という名前の CustomRecognizerNode オブジェクトの GetRecognizedString によってに返された値に設定されています。ユーザーは、TextBox にあるテキストの一部を選択しています。InkRecognitionConfidence レベルが Strong() の場合、この選択されているテキストに対応する Strokes が赤色で強調表示されます。

' Find out what's been selected in the text box
Dim start As Integer = selectedResultsTextBox.SelectionStart
Dim length As Integer = selectedResultsTextBox.SelectionLength

' Return if no text is selected.
If length = 0 Then
    Return
End If

' Only highlight if strong recognition
If customRecognizer.InkRecognitionConfidence = _
   InkRecognitionConfidence.Strong Then

    Dim selectedNodes As ContextNodeCollection = _
        customRecognizer.GetNodesFromTextRange(start, length)

    ' Use the new start and length value to update the
    ' selection in the TextBox
    selectedResultsTextBox.SelectionStart = start
    selectedResultsTextBox.SelectionLength = length

    ' Color the strokes red if part of the selected words.
    ' Otherwise, color them black.
    For Each Stroke As Stroke In customRecognizer.Strokes
        Stroke.DrawingAttributes.Color = Colors.Black
    Next Stroke

    For Each selectedNode As ContextNode In selectedNodes
        For Each Stroke As Stroke In selectedNode.Strokes
            Stroke.DrawingAttributes.Color = Colors.Red
        Next Stroke
    Next selectedNode
End If
// Find out what's been selected in the text box
int start = selectedResultsTextBox.SelectionStart;
int length = selectedResultsTextBox.SelectionLength;

// Return if no text is selected.
if (length == 0)
    return;

// Only highlight if strong recognition
if (customRecognizer.InkRecognitionConfidence == InkRecognitionConfidence.Strong)
{
    ContextNodeCollection selectedNodes =
        customRecognizer.GetNodesFromTextRange(ref start, ref length);

    // Use the new start and length value to update the
    // selection in the TextBox
    selectedResultsTextBox.SelectionStart = start;
    selectedResultsTextBox.SelectionLength = length;

    // Color the strokes red if part of the selected words.
    // Otherwise, color them black.
    foreach (Stroke stroke in customRecognizer.Strokes)
    {
        stroke.DrawingAttributes.Color = Colors.Black;
    }
    foreach (ContextNode selectedNode in selectedNodes)
    {
        foreach (Stroke stroke in selectedNode.Strokes)
        {
            stroke.DrawingAttributes.Color = Colors.Red;
        }
    }
}

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

CustomRecognizerNode クラス

CustomRecognizerNode メンバ

System.Windows.Ink 名前空間