返回值的数组,这些值指示 RealTimeStylus 对象需要的、在 Tablet 上下文 上收集的数据包。
命名空间: Microsoft.StylusInput
程序集: Microsoft.Ink(在 Microsoft.Ink.dll 中)
语法
声明
Public Function GetDesiredPacketDescription As Guid()
用法
Dim instance As RealTimeStylus
Dim returnValue As Guid()
returnValue = instance.GetDesiredPacketDescription()
public Guid[] GetDesiredPacketDescription()
public:
array<Guid>^ GetDesiredPacketDescription()
public Guid[] GetDesiredPacketDescription()
public function GetDesiredPacketDescription() : Guid[]
返回值
类型:array<System.Guid[]
返回 RealTimeStylus 对象需要的数据包属性的全局唯一标识符 (GUID)。
备注
使用此方法可以获取 RealTimeStylus 对象需要的数据包属性的数组。数据包属性由 GUID 的数组表示。PacketProperty 对象定义标准数据包属性 GUID;但也可以使用其他 GUID。
当 RealTimeStylus 对象从 tablet 收集墨迹时,RealTimeStylus 对象仅返回您设置为需要的数据包属性的数据包数据(由 GetDesiredPacketDescription 方法的返回值表示)以及正在对其收集墨迹的 Tablet 所支持的数据包属性的数据包数据。有关 RealTimeStylus 对象如何处理墨迹数据的更多信息,请参见Ink-Collection Plug-ins。
仅当禁用 RealTimeStylus 对象时才可以调用 SetDesiredPacketDescription 方法。但是,对 SetDesiredPacketDescription 方法的调用会在 GetDesiredPacketDescription 方法的返回值中立即反映出来。
下面的列表描述 RealTimeStylus 对象如何排列数据包属性 GUID 的顺序。
GetDesiredPacketDescription 方法始终在数组的前两个位置返回 PacketProperty.X 和 PacketProperty.Y GUID,无论在以前对 SetDesiredPacketDescription 方法的调用中是否指定了它们。
如果在对 SetDesiredPacketDescription 方法的调用中指定了 PacketProperty.PacketStatus GUID,则 GetDesiredPacketDescription 方法将始终在数组中最后的位置返回 PacketProperty.PacketStatus GUID。
如果在对 SetDesiredPacketDescription 方法的调用中有任何 GUID 被多次指定,则每个 GUID 在 GetDesiredPacketDescription 方法返回的数组中仅出现一次。
默认情况下,GetDesiredPacketDescription 方法返回 PacketProperty.X、PacketProperty.Y 和 PacketProperty.NormalPressure GUID。
例如,如果使用 (a, b, a, PacketStatus, b, c, d) 调用 SetDesiredPacketDescription 方法,则对 GetDesiredPacketDescription 方法的调用将返回 (X, Y, a, b, c, d, PacketStatus)。
示例
此 C# 示例是菜单项的 Click 事件处理程序中的代码段。该菜单是定义了 TextBox 对象 theTextBox 的窗体的一部分。该事件处理程序调用 RealTimeStylus 对象的 GetDesiredPacketDescription 方法。
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));
}
}
平台
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0