GestureRecognitionResult.RecognitionConfidence 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取 GestureRecognizer 识别笔势的置信度。
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
属性值
RecognitionConfidence 级别值之一。
示例
以下示例演示如何标识 上的 InkCanvas手势。 此示例假定有一个 InkCanvas 被调用 inkCanvas1
的 ,并且其 Gesture 事件已连接到代码中的事件处理程序。
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