다음을 통해 공유


Stroke.GetPacketValuesByProperty 메서드 (Guid, Int32, Int32)

업데이트: 2007년 11월

Stroke 개체의 패킷 범위에 대한 지정된 패킷 속성 데이터를 반환합니다.

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

구문

‘선언
Public Function GetPacketValuesByProperty ( _
    id As Guid, _
    index As Integer, _
    count As Integer _
) As Integer()
‘사용 방법
Dim instance As Stroke
Dim id As Guid
Dim index As Integer
Dim count As Integer
Dim returnValue As Integer()

returnValue = instance.GetPacketValuesByProperty(id, _
    index, count)
public int[] GetPacketValuesByProperty(
    Guid id,
    int index,
    int count
)
public:
array<int>^ GetPacketValuesByProperty(
    Guid id, 
    int index, 
    int count
)
public int[] GetPacketValuesByProperty(
    Guid id,
    int index,
    int count
)
public function GetPacketValuesByProperty(
    id : Guid, 
    index : int, 
    count : int
) : int[]

매개 변수

  • index
    형식: System.Int32
    Stroke 개체 내에서 패킷에 대해 0부터 시작하는 인덱스의 시작점입니다.
  • count
    형식: System.Int32
    스트로크 데이터를 구성하는 점의 수입니다.

반환 값

형식: array<System.Int32[]
Stroke 개체의 요청된 각 점에 대한 요청된 PacketProperty 개체의 값을 나타내는 부호 있는 32비트 정수 배열을 반환합니다.

설명

Stroke 개체에 따라 특정 패킷 속성을 사용할 수 없을 수도 있습니다. Tablet PC에 사용자가 입력하는 태블릿이 둘 이상 있을 수 있습니다. Tablets 컬렉션에는 Tablet PC에 연결된 모든 태블릿의 목록이 들어 있습니다. 해당 패킷 속성이 특정 Tablet 개체에서 지원되는지 또는 사용 가능한 모든 태블릿에서 지원되는지 확인하려면 IsPacketPropertySupported 메서드를 사용합니다. 또한 InkCollector.DesiredPacketDescription, InkOverlay.DesiredPacketDescription 또는 InkPicture.DesiredPacketDescription 속성을 사용하여 새 스트로크에서 수집할 패킷 속성을 제어합니다.

예제

이 예제에서는 InkOverlay 개체의 선택된 Stroke 개체를 각각 수정하여 스트로크의 앞쪽 절반에 있는 각 점에 허용되는 최소 NormalPressure 패킷 값을 포함시킵니다.

GetPacketValuesByProperty 메서드를 사용하여 Stroke 개체의 앞쪽 절반에 대한 NormalPressure 패킷 값을 가져옵니다. 그런 다음 GetPacketDescriptionPropertyMetrics 메서드를 통해 가져온 허용되는 최소값으로 설정하고 SetPacketValuesByProperty 메서드를 사용하여 스트로크에 값을 다시 적용합니다.

Try
    For Each S As Stroke In mInkOverlay.Selection
        ' get the PacketProperty.NormalPressure metrics for the stroke
        Dim metrics As TabletPropertyMetrics = S.GetPacketDescriptionPropertyMetrics(PacketProperty.NormalPressure)
        ' we want to get half of the NormalPressure values
        Dim halfWayPt As Integer = S.PacketCount / 2
        ' get the NormalPressure values for the first half of the packets
        Dim npValues() As Integer = S.GetPacketValuesByProperty(PacketProperty.NormalPressure, 0, halfWayPt)
        ' set the NormalPressure values to min
        For k As Integer = 0 To npValues.Length - 1
            npValues(k) = metrics.Minimum
        Next
        ' set the NormalPressure values for the first half of the packets
        S.SetPacketValuesByProperty(PacketProperty.NormalPressure, 0, halfWayPt, npValues)
    Next
Catch ex As ArgumentException
    ' This exception will be raised if PacketProperty.NormalPressure is not supported
    ' This will be the case if creating strokes with a mouse
End Try
try
{
    foreach (Stroke S in mInkOverlay.Selection)
    {
        // get the PacketProperty.NormalPressure metrics for the stroke
        TabletPropertyMetrics metrics = S.GetPacketDescriptionPropertyMetrics(PacketProperty.NormalPressure);
        // we want to get half of the NormalPressure values
        int halfWayPt = S.PacketCount / 2;
        // get the NormalPressure values for the first half of the packets
        int[] npValues = S.GetPacketValuesByProperty(PacketProperty.NormalPressure, 0, halfWayPt);
        // set the NormalPressure values to min
        for (int k = 0; k < npValues.Length; k++)
        {
            npValues[k] = metrics.Minimum;
        }
        // set the NormalPressure values for the first half of the packets
        S.SetPacketValuesByProperty(PacketProperty.NormalPressure, 0, halfWayPt, npValues);
    }
}
catch (ArgumentException)
{
    // This exception will be raised if PacketProperty.NormalPressure is not supported
    // This will be the case if creating strokes with a mouse
}

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

Stroke 클래스

Stroke 멤버

GetPacketValuesByProperty 오버로드

Microsoft.Ink 네임스페이스

InkCollector.DesiredPacketDescription

InkOverlay.DesiredPacketDescription

InkPicture.DesiredPacketDescription

PacketProperty

Tablet

Tablet.IsPacketPropertySupported

Tablets

Tablets.IsPacketPropertySupported