NewInAirPackets イベントを生成した Cursor オブジェクトを取得します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink (Microsoft.Ink.dll 内)
構文
'宣言
Public ReadOnly Property Cursor As Cursor
'使用
Dim instance As InkCollectorNewInAirPacketsEventArgs
Dim value As Cursor
value = instance.Cursor
public Cursor Cursor { get; }
public:
property Cursor^ Cursor {
Cursor^ get ();
}
/** @property */
public Cursor get_Cursor()
public function get Cursor () : Cursor
プロパティ値
型 : Microsoft.Ink.Cursor
NewInAirPackets イベントを生成したオブジェクト。
解説
Microsoft.Ink.Cursor クラスを System.Windows.Fo クラスと混同しないようにしてください。Microsoft.Ink.Cursor は、タブレット ポインティング デバイスやタブレット選択デバイス (通常はペン) を表しますが、System.Windows.Forms.Cursor は、マウス ポインタの描画に使用されるイメージを表します。
例
この例では、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 クラス