共用方式為


Gesture.Confidence 屬性

取得「辨識器」在辨識「筆勢」時所擁有的信賴等級 (高度、中度或低度)。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public ReadOnly Property Confidence As RecognitionConfidence
'用途
Dim instance As Gesture
Dim value As RecognitionConfidence

value = instance.Confidence
public RecognitionConfidence Confidence { get; }
public:
property RecognitionConfidence Confidence {
    RecognitionConfidence get ();
}
/** @property */
public RecognitionConfidence get_Confidence()
public function get Confidence () : RecognitionConfidence

屬性值

型別:Microsoft.Ink.RecognitionConfidence
辨識器在辨識筆勢時所擁有的信賴等級 (高度、中度或低度)。

備註

ms582124.alert_note(zh-tw,VS.90).gif注意事項:

在目前的 Windows XP Tablet PC Edition 發行版本中,所有的筆勢辨識都可進行信賴等級評估。

如需可能傳回的信賴等級值清單,請參閱 RecognitionConfidence 列舉型別。

範例

在這個範例中,當辨識「應用程式筆勢」時,會引發事件處理常式。只有應用程式特別要求的 ApplicationGesture 型別 (藉由呼叫 SetGestureStatus 方法) 才會引發事件。在檢查傳至事件處理常式的第一個 Gesture 物件時,如果針對 Check 筆勢將 Confidence 屬性設定為高度信賴,則會在 HotPoint 屬性所表示的座標周圍繪製小圓形。

' event handler for InkOverlay.Gesture event
Private Sub mInkObject_Gesture(ByVal sender As Object, ByVal e As InkCollectorGestureEventArgs)
    ' There might be more than one gesture passed in InkCollectorGestureEventArgs
    ' The gestures are arranged in order of confidence from most to least
    ' This event handler is only concerned with the first (most confident) gesture
    ' and only if the first gesture has RecognitionConfidence.Strong
    Dim G As Gesture = e.Gestures(0)

    ' if this is ApplicationGesture.Check of RecognitionConfidence.Strong confidence
    If ApplicationGesture.Check = G.Id And RecognitionConfidence.Strong = G.Confidence Then
        Dim mInkOverlay As InkOverlay = DirectCast(sender, InkOverlay)
        ' assuming here that InkOverlay.AttachedControl property is set.
        ' This can be set with the .ctor InkOverlay(Control C) or the
        ' InkOverlay.AttachedControl property can be set later.
        Using GR As Graphics = mInkOverlay.AttachedControl.CreateGraphics()
            ' get the hot point
            Dim hotPoint As Point = G.HotPoint
            ' convert to pixel coordinates
            mInkOverlay.Renderer.InkSpaceToPixel(GR, hotPoint)
            ' draw a small circle
            GR.DrawEllipse(Pens.Orange, hotPoint.X - 6, hotPoint.Y - 6, 12, 12)
            ' cancel the event. This prevents the gesture from disappearing
            ' and lets you see the small circle and the gesture together
            e.Cancel = True
        End Using
    End If
End Sub
// event handler for InkOverlay.Gesture event
private void mInkObject_Gesture(object sender, InkCollectorGestureEventArgs e)
{
    // There might be more than one gesture passed in InkCollectorGestureEventArgs
    // The gestures are arranged in order of confidence from most to least
    // This event handler is only concerned with the first (most confident) gesture
    // and only if the first gesture has RecognitionConfidence.Strong
    Gesture G = e.Gestures[0];

    // if this is ApplicationGesture.Check of RecognitionConfidence.Strong confidence
    if (ApplicationGesture.Check == G.Id && RecognitionConfidence.Strong == G.Confidence)
    {
        InkOverlay mInkOverlay = (InkOverlay)sender;
        // assuming here that InkOverlay.AttachedControl property is set.
        // This can be set with the .ctor InkOverlay(Control C) or the
        // InkOverlay.AttachedControl property can be set later.
        using (Graphics GR = mInkOverlay.AttachedControl.CreateGraphics())
        {
            // get the hot point
            Point hotPoint = G.HotPoint;
            // convert to pixel coordinates
            mInkOverlay.Renderer.InkSpaceToPixel(GR, ref hotPoint);
            // draw a small circle
            GR.DrawEllipse(Pens.Orange, hotPoint.X - 6, hotPoint.Y - 6, 12, 12);
            // cancel the event. This prevents the gesture from disappearing
            // and lets you see the small circle and the gesture together
            e.Cancel = true;
        }
    }
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

Gesture 類別

Gesture 成員

Microsoft.Ink 命名空間

DrawingAttributes.ExtendedProperties

ExtendedProperties

Stroke.ExtendedProperties