InkCollectorNewPacketsEventArgs.PacketCount 属性

获取为 Stroke 对象收到的数据包 的数目。

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

语法

声明
Public ReadOnly Property PacketCount As Integer
用法
Dim instance As InkCollectorNewPacketsEventArgs
Dim value As Integer

value = instance.PacketCount
public int PacketCount { get; }
public:
property int PacketCount {
    int get ();
}
/** @property */
public int get_PacketCount()
public function get PacketCount () : int

属性值

类型:System.Int32
Stroke 对象收到的数据包的数目。

示例

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

Private Sub mInkObject_NewPackets2(ByVal sender As Object, ByVal e As InkCollectorNewPacketsEventArgs)
    Dim DescriptorsPerPacket As Integer = e.Stroke.PacketDescription.Length
    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_NewPackets2(object sender, InkCollectorNewPacketsEventArgs e)
{

    int DescriptorsPerPacket = e.Stroke.PacketDescription.Length;
    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

另请参见

参考

InkCollectorNewPacketsEventArgs 类

InkCollectorNewPacketsEventArgs 成员

Microsoft.Ink 命名空间

InkCollector.NewPackets