InkCollectorNewInAirPacketsEventArgs.PacketCount-Eigenschaft
Ruft die Anzahl der empfangenen In-Air-Pakete ab.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public ReadOnly Property PacketCount As Integer
'Usage
Dim instance As InkCollectorNewInAirPacketsEventArgs
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
Eigenschaftenwert
Typ: System.Int32
Die Anzahl der empfangenen In-Air-Pakete.
Hinweise
In-Air-Pakete werden empfangen, wenn ein Cursor-Objekt in den physischen Erfassungsbereich (die Nähe) des Tablettkontexts eintritt.
Beispiele
In diesem Beispiel ruft eine InkCollectorNewInAirPacketsEventHandler-Instanz den X-Wert und den Y-Wert des letzten über das InkCollectorNewInAirPacketsEventArgs-Objekt übergebenen Pakets ab. Der X-Wert und der Y-Wert befinden sich immer an den ersten zwei Positionen der Paketdaten.
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];
}
Plattformen
Windows Vista
.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.
Versionsinformationen
.NET Framework
Unterstützt in: 3.0
Siehe auch
Referenz
InkCollectorNewInAirPacketsEventArgs-Klasse