Recognizer.PreferredPacketDescription 属性

获取一个 Guid 类型的数组,该数组表示识别器 的首选数据包 属性。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public ReadOnly Property PreferredPacketDescription As Guid()
用法
Dim instance As Recognizer
Dim value As Guid()

value = instance.PreferredPacketDescription
public Guid[] PreferredPacketDescription { get; }
public:
property array<Guid>^ PreferredPacketDescription {
    array<Guid>^ get ();
}
/** @property */
public Guid[] get_PreferredPacketDescription()
public function get PreferredPacketDescription () : Guid[]

属性值

类型:array<System.Guid[]
表示识别器的首选数据包属性。

备注

PreferredPacketDescription 属性描述数据包 的内容,并且不允许访问数据包中的数据。

PreferredPacketDescription 属性列出了识别器用于完成识别的数据包属性。对于所有 Microsoft(R) 识别器,PreferredPacketDescription 属性引用描述 Stroke 对象中的 (x,y) 坐标的数据。此数据由 PacketProperty 对象的 XY 字段表示。数据包包含此点数据以及与该笔画相关的其他数据,例如笔画对应的笔的压力、笔的角度等等。Microsoft 识别器忽略压力、倾斜角度和其他数据包属性。

示例

此 C# 示例创建一个函数,如果 Recognizer 对象 theRecognizer 的一个首选数据包描述是 X,则此函数将返回 true。

using Microsoft.Ink;
// . . .
public bool PrefersX(Recognizer theRecognizer)
{
    Guid[] theDescription =
        theRecognizer.PreferredPacketDescription;
    for (int i = 0; i < theDescription.Length; i++)
    {
        if (theDescription[i] == PacketProperty.X)
            return true;
    }
    return false;
}

此 Microsoft Visual Basic(R) .NET 示例创建一个函数,如果 Recognizer 对象 theRecognizer 的一个首选数据包描述是 X,则此函数将返回 true。

Imports Microsoft.Ink
' . . .
Public Function PrefersX(ByVal theRecognizer As Recognizer) As Boolean
    Dim theDescription () As Guid
    TheDescription = theRecognizer.PreferredPacketDescription
    Dim k As Integer
    For k = 0 To theDescription.Length
        If theDescription(k).ToString() = PacketProperty.X.ToString() Then
            Return True
        End If
    Next
    Return False
End Function

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

Recognizer 类

Recognizer 成员

Microsoft.Ink 命名空间

Recognizer

PacketProperty

PacketProperty.X

PacketProperty.Y