RealTimeStylus.GetDesiredPacketDescription Method
Returns an array of values that indicate the packet collected on a tablet context for which the RealTimeStylus object has interest.
Namespace: Microsoft.StylusInput
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public Function GetDesiredPacketDescription As Guid()
'Usage
Dim instance As RealTimeStylus
Dim returnValue As Guid()
returnValue = instance.GetDesiredPacketDescription()
public Guid[] GetDesiredPacketDescription()
public:
array<Guid>^ GetDesiredPacketDescription()
public function GetDesiredPacketDescription() : Guid[]
Return Value
Type: array<System.Guid[]
Returns the globally unique identifiers (GUIDs) for the packet properties in which the RealTimeStylus object is interested.
Remarks
Use this method to get the array of packet properties in which the RealTimeStylus object has interest. The packet properties are represented by an array of GUIDs. The PacketProperty object defines standard packet property GUIDs; however, other GUIDs may also be used.
When the RealTimeStylus object is collecting ink from a tablet, the RealTimeStylus object returns packet data only for the packet properties that you have set interest in—as represented by the return value of the GetDesiredPacketDescription method—and that are supported by the tablet on which the ink is being collected. For more information about how ink data is handled by the RealTimeStylus object, see Ink-Collection Plug-ins.
The SetDesiredPacketDescription method can only be called while the RealTimeStylus object is disabled. However, calls to the SetDesiredPacketDescription method are immediately reflected in the return value of the GetDesiredPacketDescription method.
The following list describes how the RealTimeStylus object orders the packet property GUIDs.
The PacketProperty.X and PacketProperty.Y GUIDs are always returned in the first two positions in the array by the GetDesiredPacketDescription method, whether or not they were specified in a previous call to the SetDesiredPacketDescription method.
If the PacketProperty.PacketStatus GUID is specified in the call to the SetDesiredPacketDescription method, the PacketProperty.PacketStatus GUID is always returned in the last position in the array by the GetDesiredPacketDescription method.
If any GUIDs are specified more than once in the call to the SetDesiredPacketDescription method, each GUID occurs only once in the array returned by the GetDesiredPacketDescription method.
By default, the GetDesiredPacketDescription method returns the PacketProperty.X, PacketProperty.Y, and PacketProperty.NormalPressure GUIDs.
For example, if you call the SetDesiredPacketDescription method with (a, b, a, PacketStatus, b, c, d), a call to the GetDesiredPacketDescription method returns (X, Y, a, b, c, d, PacketStatus).
Examples
This C# example is a snippet from a menu item's Click event handler. The menu is part of a form on which a TextBox object, theTextBox, is defined. The event handler calls the RealTimeStylus object's GetDesiredPacketDescription method.
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;
// ...
// The GetDesiredPacketDescription menu item's ClickEventHandler
private void theMenuItemGetDesiredPacketDescription_Click(object sender,
System.EventArgs e)
{
this.theTextBox.Text = "DesiredPacketDescription = " + Environment.NewLine;
foreach (Guid theGuid in this.thePrimaryRealTimeStylus.GetDesiredPacketDescription())
{
this.theTextBox.Text += string.Format(" {0}" + Environment.NewLine,
this.GetPacketPropertyNameFromGuid(theGuid));
}
}
Platforms
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
Microsoft.StylusInput Namespace