パケットの選択したデータが含まれる、型が Int32 の配列を取得します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink (Microsoft.Ink.dll 内)
構文
'宣言
Public ReadOnly Property PacketData As Integer()
'使用
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[]
プロパティ値
型 : array<System.Int32[]
パケットの選択したデータが含まれる配列。
解説
この配列に含まれるプロパティを設定するには、InkCollector オブジェクトの DesiredPacketDescription プロパティを使用します。PacketData プロパティが返す配列には、それらのプロパティのデータが含まれます。
![]() |
---|
パケット データを変更することはできますが、それらの変更を永続化したり、使用したりすることはできません。 |
PacketData プロパティに含めることができるプロパティの一覧については、InkCollector オブジェクトの DesiredPacketDescription プロパティを参照してください。
例
この例では、InkCollectorNewInAirPacketsEventHandler インスタンスが、InkCollectorNewInAirPacketsEventArgs オブジェクトを介して渡された最後のパケットの X 値および Y 値を取得します。X 値および Y 値は、常にパケット データの最初の 2 つの位置に存在します。
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 クラス