RecognitionConfidence 枚举

定义

指定 GestureRecognizer 确定特定墨迹笔势的置信度。Specifies the confidence level that the GestureRecognizer determines for a particular ink gesture.

public enum class RecognitionConfidence
public enum RecognitionConfidence
type RecognitionConfidence = 
Public Enum RecognitionConfidence
继承
RecognitionConfidence

字段

Intermediate 1

指示识别结果的置信度中等。Indicates intermediate confidence in the recognition result.

Poor 2

指示识别结果的置信度很低。Indicates poor confidence in the recognition result.

Strong 0

指示识别结果的置信度很高。Indicates strong confidence in the recognition result.

示例

下面的示例演示如何在上InkCanvas标识笔势。The following example demonstrates how to identify a gesture on an InkCanvas. 此示例假设有一个InkCanvas被调用inkCanvas1的, 并且其Gesture事件已连接到此示例中的事件处理程序。This example assumes that there is an InkCanvas called inkCanvas1 and that its Gesture event has been connected to the event handler in this example.

void inkCanvas1_Gesture(object sender, InkCanvasGestureEventArgs e)
{
    ReadOnlyCollection<GestureRecognitionResult> gestureResults = 
        e.GetGestureRecognitionResults();

    // Check the first recognition result for a gesture.
    if (gestureResults[0].RecognitionConfidence == 
        RecognitionConfidence.Strong)
    {
        switch (gestureResults[0].ApplicationGesture)
        {
            case ApplicationGesture.Down:
                // Do something.
                break;
            case ApplicationGesture.ArrowDown:
                // Do something.
                break;
            case ApplicationGesture.Circle:
                // Do something.
                break;
        }

    }
}
Sub inkCanvas1_Gesture(ByVal sender As Object, _
    ByVal e As InkCanvasGestureEventArgs) Handles inkCanvas1.Gesture

    Dim gestureResults As ReadOnlyCollection(Of GestureRecognitionResult)
    gestureResults = e.GetGestureRecognitionResults()

    ' Check the first recognition result for a gesture.
    If gestureResults(0).RecognitionConfidence = _
       RecognitionConfidence.Strong Then

        Select Case gestureResults(0).ApplicationGesture
            Case ApplicationGesture.Down
                ' Do something.
            Case ApplicationGesture.ArrowDown
                ' Do something.
            Case ApplicationGesture.Circle
                ' Do something.
        End Select

    End If

End Sub

注解

XAML 文本用法XAML Text Usage

此类通常不在 XAML 中使用。This class is not typically used in XAML.

适用于