获取生成 NewInAirPackets 事件的 Cursor 对象。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink(在 Microsoft.Ink.dll 中)
语法
声明
Public ReadOnly Property Cursor As Cursor
用法
Dim instance As InkCollectorNewInAirPacketsEventArgs
Dim value As Cursor
value = instance.Cursor
public Cursor Cursor { get; }
public:
property Cursor^ Cursor {
Cursor^ get ();
}
/** @property */
public Cursor get_Cursor()
public function get Cursor () : Cursor
属性值
类型:Microsoft.Ink.Cursor
生成 NewInAirPackets 事件的对象。
备注
请不要将 Microsoft.Ink.Cursor 类与 System.Windows.Fo 类混淆。Microsoft.Ink.Cursor 表示有关 Tablet 指针和选择设备(通常是笔)的一般信息,而 System.Windows.Forms.Cursor 表示用于绘制鼠标指针的图像。
示例
在此示例中,InkCollectorNewInAirPacketsEventHandler 实例获得通过 InkCollectorNewInAirPacketsEventArgs 对象传递的最后一个数据包的 X 和 Y 值。X 和 Y 值总是位于数据包数据的前两个位置。
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 类