Proprietà InkCollectorNewInAirPacketsEventArgs.PacketData
Aggiornamento: novembre 2007
Ottiene una matrice di tipo Int32 che contiene i dati selezionati per il pacchetto.
Spazio dei nomi: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Sintassi
'Dichiarazione
Public ReadOnly Property PacketData As Integer()
'Utilizzo
Dim instance As InkCollectorNewInAirPacketsEventArgs
Dim value As Integer()
value = instance.PacketData
public int[] PacketData { get; }
public:
property array<int>^ PacketData {
array<int>^ get ();
}
/** @property */
public int[] get_PacketData()
public function get PacketData () : int[]
Valore proprietà
Tipo: array<System.Int32[]
Matrice che contiene i dati selezionati per il pacchetto.
Note
Per impostare le proprietà che devono essere contenute in questa matrice, utilizzare la proprietà DesiredPacketDescription dell'oggetto InkCollector. La matrice restituita dalla proprietà PacketData contiene i dati per quelle proprietà.
Nota
Anche se è possibile modificare i dati del pacchetto, queste modifiche non vengono salvate in modo permanente o utilizzate.
Per un elenco completo di tutte le possibili proprietà per cui è possibile includere i dati nella proprietà PacketData, vedere la proprietà DesiredPacketDescription dell'oggetto InkCollector.
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