Proprietà InkCollectorNewInAirPacketsEventArgs.PacketCount
Aggiornamento: novembre 2007
Ottiene il numero di pacchetti in-air ricevuti.
Spazio dei nomi: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Sintassi
'Dichiarazione
Public ReadOnly Property PacketCount As Integer
'Utilizzo
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
Valore proprietà
Tipo: System.Int32
Numero di pacchetti in-air ricevuti.
Note
I pacchetti in-air vengono ricevuti quando un oggetto Cursor immette l'intervallo di rilevamento fisico (prossimità) del contesto della tavoletta.
Esempi
In questo esempio, un'istanza InkCollectorNewInAirPacketsEventHandler ottiene i valori X e Y dell'ultimo pacchetto passato tramite l'oggetto InkCollectorNewInAirPacketsEventArgs. I valori X e Y si trovano sempre nelle prime due posizioni dei dati del pacchetto.
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];
}
Piattaforme
Windows Vista
.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.
Informazioni sulla versione
.NET Framework
Supportato in: 3.0
Vedere anche
Riferimenti
InkCollectorNewInAirPacketsEventArgs Classe