Partager via


GestureRecognitionResult.RecognitionConfidence Propriété

Définition

Obtient le niveau de confiance que le GestureRecognizer a dans la reconnaissance du mouvement.

public:
 property System::Windows::Ink::RecognitionConfidence RecognitionConfidence { System::Windows::Ink::RecognitionConfidence get(); };
public System.Windows.Ink.RecognitionConfidence RecognitionConfidence { get; }
member this.RecognitionConfidence : System.Windows.Ink.RecognitionConfidence
Public ReadOnly Property RecognitionConfidence As RecognitionConfidence

Valeur de propriété

L'un des niveaux RecognitionConfidence.

Exemples

L’exemple suivant montre comment identifier un mouvement sur un InkCanvas. Cet exemple suppose qu’il existe un InkCanvas appelé inkCanvas1 et que son Gesture événement a été connecté au gestionnaire d’événements dans le code.

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

S’applique à