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