InkCollectorNewInAirPacketsEventArgs.PacketCount, propriété
Mise à jour : November 2007
Obtient le nombre de paquets in-air reçus.
Espace de noms : Microsoft.Ink
Assembly : Microsoft.Ink (dans Microsoft.Ink.dll)
Syntaxe
'Déclaration
Public ReadOnly Property PacketCount As Integer
'Utilisation
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
Valeur de propriété
Type : System.Int32
Nombre de paquets in-air reçus.
Notes
Les paquets in-air sont reçus lorsqu'un objet Cursor entre dans la plage de détection physique (proximité) du contexte de la tablette.
Exemples
Dans cet exemple, une instance InkCollectorNewInAirPacketsEventHandler obtient les valeurs X et Y du dernier paquet passé via l'objet InkCollectorNewInAirPacketsEventArgs. X et Y sont toujours les deux premières valeurs des données de paquet.
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];
}
Plateformes
Windows Vista
Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Informations de version
.NET Framework
Pris en charge dans : 3.0
Voir aussi
Référence
InkCollectorNewInAirPacketsEventArgs, classe