다음을 통해 공유


InkCollectorNewInAirPacketsEventArgs.PacketCount 속성

업데이트: 2007년 11월

수신한 in-air 패킷의 수를 가져옵니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink(Microsoft.Ink.dll)

구문

‘선언
Public ReadOnly Property PacketCount As Integer
‘사용 방법
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

속성 값

형식: System.Int32
수신한 in-air 패킷의 수입니다.

설명

in-air 패킷은 Cursor 개체가 태블릿 컨텍스트의 물리적 감지 범위(영역) 안에 들어올 때 발생합니다.

예제

이 예제에서 InkCollectorNewInAirPacketsEventHandler 인스턴스는 InkCollectorNewInAirPacketsEventArgs 개체를 통해 전달된 마지막 패킷의 XY 값을 가져옵니다. 패킷 데이터의 처음 두 위치는 항상 XY 값이 차지합니다.

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 클래스

InkCollectorNewInAirPacketsEventArgs 멤버

Microsoft.Ink 네임스페이스

InkCollector.NewInAirPackets