Freigeben über


Recognizer.PreferredPacketDescription Property

Recognizer.PreferredPacketDescription Property

Gets an array of type Guid Leave Site that represents the preferred packet properties for the recognizer.

Definition

Visual Basic .NET Public ReadOnly Property PreferredPacketDescription As Guid()
C# public Guid[] PreferredPacketDescription { get; }
Managed C++ public: __property Guid* get_PreferredPacketDescription();

Property Value

System.Guid[]. Represents the preferred packet properties for the recognizer.

This property is read-only. This property has no default value.

Remarks

The PreferredPacketDescription property describes the contents of a packet and does not allow access to the data that the packet contains.

The PreferredPacketDescription property lists the packet properties that the recognizer uses to complete recognition. For all of the Microsoft® recognizers, the PreferredPacketDescription property refers to the data describing (x,y) coordinates within a Stroke object. This data is represented by the X and Y fields of the PacketProperty object. A packet contains this point data as well as other data that is related to that stroke, such as the pressure of the pen that made the stroke, the angle of the pen, and so on. The Microsoft recognizers ignore pressure, tilt, and other packet properties.

Examples

[C#]

This C# example creates a function that returns true if the Recognizer object, theRecognizer, has X as one of its preferred packet descriptions.

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;
}

[Visual Basic .NET]

This Microsoft Visual Basic® .NET example creates a function that returns true if the Recognizer object, theRecognizer, has X as one of its preferred packet descriptions.

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

See Also