InkCollectorNewInAirPacketsEventArgs.PacketData 属性

获取 Int32 类型的数组,其中包含数据包的选定数据。

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

语法

声明
Public ReadOnly Property PacketData As Integer()
用法
Dim instance As InkCollectorNewInAirPacketsEventArgs
Dim value As Integer()

value = instance.PacketData
public int[] PacketData { get; }
public:
property array<int>^ PacketData {
    array<int>^ get ();
}
/** @property */
public int[] get_PacketData()
public function get PacketData () : int[]

属性值

类型:array<System.Int32[]
包含数据包的选定数据的数组。

备注

若要设置在此数组中包含哪些属性,可使用 InkCollector 对象的 DesiredPacketDescription 属性。PacketData 属性返回的数组包含这些属性的数据。

备注

您可以修改数据包数据,但所做的修改不会保存,也不会被使用。

有关可在 PacketData 属性中为其包含数据的所有可能属性的完整列表,请参见 InkCollector 对象的 DesiredPacketDescription 属性。

示例

在此示例中,InkCollectorNewInAirPacketsEventHandler 实例获得通过 InkCollectorNewInAirPacketsEventArgs 对象传递的最后一个数据包的 XY 值。XY 值总是位于数据包数据的前两个位置。

Private Sub mInkObject_NewInAirPackets2(ByVal sender As Object, ByVal e As InkCollectorNewInAirPacketsEventArgs)
    Dim DescriptorsPerPacket As Integer = 0
    ' determine how many descriptors there are per packet
    ' you could also obtain this value using:
    '   e.PacketData.Length / e.PacketCount
    ' but if you need to know which particular properties
    ' are supported (beyond X and Y which are always placed first)
    ' you will need to query e.Cursor.Tablet.IsPacketPropertySupported()
    For Each G As Guid In mInkObject.DesiredPacketDescription
        If (e.Cursor.Tablet.IsPacketPropertySupported(G)) Then
            DescriptorsPerPacket += 1
        End If
    Next

    Dim LastX As Integer = e.PacketData(DescriptorsPerPacket * (e.PacketCount - 1))
    Dim LastY As Integer = e.PacketData((DescriptorsPerPacket * (e.PacketCount - 1)) + 1)
End Sub
private void mInkObject_NewInAirPackets2(object sender, InkCollectorNewInAirPacketsEventArgs e)
{
    int DescriptorsPerPacket = 0;
    // determine how many descriptors there are per packet
    // you could also obtain this value using:
    //   e.PacketData.Length / e.PacketCount
    // but if you need to know which particular properties
    // are supported (beyond X and Y which are always placed first)
    // you will need to query e.Cursor.Tablet.IsPacketPropertySupported()

    foreach (Guid G in mInkObject.DesiredPacketDescription)
    {
        if (e.Cursor.Tablet.IsPacketPropertySupported(G))
        {
            DescriptorsPerPacket++;
        }
    }

    int LastX = e.PacketData[DescriptorsPerPacket * (e.PacketCount - 1)];
    int LastY = e.PacketData[(DescriptorsPerPacket * (e.PacketCount - 1)) + 1];

}

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkCollectorNewInAirPacketsEventArgs 类

InkCollectorNewInAirPacketsEventArgs 成员

Microsoft.Ink 命名空间

InkCollector.NewInAirPackets

InkCollector.DesiredPacketDescription