共用方式為


GestureAlternate.Confidence 屬性

取得筆勢辨識器指派給這個替代項目的信賴等級。

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

語法

'宣告
Public ReadOnly Property Confidence As RecognitionConfidence
'用途
Dim instance As GestureAlternate
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
RecognitionConfidence 列舉型別的成員,表示筆勢辨識器指派給這個替代項目的信賴等級。

範例

這個 Microsoft Visual C# .NET 範例是程式碼片段,來自 IStylusAsyncPlugin 介面之 CustomStylusDataAdded 方法的實作。實作 IStylusAsyncPlugin 介面的表單包含 TextBox (英文) 物件 theTextBox。CustomStylusDataAdded 物件會檢查 GestureRecognizer 物件的自訂手寫筆資料,並顯示 GestureRecognizer 物件已辨識之任何筆勢的相關資訊。

using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;

// ...

// Declare the RealTimeStylus objects, the GestureRecognizer plugin,
// and the DynamicRenderer plug-in.
private Microsoft.StylusInput.RealTimeStylus thePrimaryRealTimeStylus = null;
private Microsoft.StylusInput.RealTimeStylus theSecondaryRealTimeStylus = null;
private Microsoft.StylusInput.GestureRecognizer theGestureRecognizer = null;
private Microsoft.StylusInput.DynamicRenderer theDynamicRenderer = null;

// ...

// Informs the implementing object that user data is available.
public void CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data)
{
    // We can identify the kind of custom data via either the Guid or Type.
    // For the purpose of this demonstration we will validate both just to be safe.
    // For other scenarios either approach is valid.
    if (data.CustomDataId == GestureRecognizer.GestureRecognitionDataGuid)
    {
        // Cast the custom stylus data to gesture recognition data.
        GestureRecognitionData theData = data.Data as GestureRecognitionData;

        // If there is data in the notification, then display the information
        // for all of the gestures recognized.
        if (theData != null && theData.Count > 0)
        {
            this.theTextBox.Text = "GestureRecognitionData:" + Environment.NewLine;
            foreach (GestureAlternate theGesture in theData)
            {
                this.theTextBox.Text += string.Format(
                    "  Gesture {0,-10}, Confidence {1,-8}, Count {2}."
                    + Environment.NewLine, theGesture.Id,
                    theGesture.Confidence, theGesture.StrokeCount);
            }
            this.theTextBox.Text += Environment.NewLine;
        }
    }
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

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

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

GestureAlternate 類別

GestureAlternate 成員

Microsoft.StylusInput.PluginData 命名空間

Microsoft.Ink.RecognitionConfidence