GestureRecognitionResult Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Contains information about an ink gesture.
public ref class GestureRecognitionResult
public class GestureRecognitionResult
type GestureRecognitionResult = class
Public Class GestureRecognitionResult
- Inheritance
-
GestureRecognitionResult
Examples
The following example demonstrates how to identify a gesture on an InkCanvas. This example assumes that there is an InkCanvas called inkCanvas1
and that its Gesture event has been connected to the event handler in the 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
Remarks
A GestureRecognitionResult contains an ApplicationGesture and the level of likeliness that the GestureRecognizer correctly identified the gesture.
Use the RecognitionConfidence property to determine the level of likeliness that the GestureRecognizer correctly identified the gesture.
Properties
ApplicationGesture |
Gets the recognized ink gesture. |
RecognitionConfidence |
Gets the level of confidence that the GestureRecognizer has in the recognition of the gesture. |
Methods
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |