取得產生 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 表示手寫板點選裝置 (通常是畫筆) 的一般資訊,而 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 類別