RealTimeStylus.SetDesiredPacketDescription 메서드
업데이트: 2007년 11월
태블릿 컨텍스트에서 수집된 패킷을 기준으로 RealTimeStylus 개체의 관심도를 설정합니다.
네임스페이스: Microsoft.StylusInput
어셈블리: Microsoft.Ink(Microsoft.Ink.dll)
구문
‘선언
Public Sub SetDesiredPacketDescription ( _
value As Guid() _
)
‘사용 방법
Dim instance As RealTimeStylus
Dim value As Guid()
instance.SetDesiredPacketDescription(value)
public void SetDesiredPacketDescription(
Guid[] value
)
public:
void SetDesiredPacketDescription(
array<Guid>^ value
)
public void SetDesiredPacketDescription(
Guid[] value
)
public function SetDesiredPacketDescription(
value : Guid[]
)
매개 변수
- value
형식: array<System.Guid[]
RealTimeStylus 개체에서 관심도를 설정할 패킷 속성의 GUID(Globally Unique Identifier)입니다.
설명
이 메서드를 사용하여 패킷 속성 집합에 대한 RealTimeStylus 개체의 관심도를 설정할 수 있습니다. 패킷 속성은 GUID의 배열로 표현됩니다. PacketProperty 개체는 표준 패킷 속성 GUID를 정의하지만 다른 GUID도 사용할 수 있습니다.
RealTimeStylus 개체가 Tablet 개체에서 잉크를 수집할 때 RealTimeStylus 개체는 GetDesiredPacketDescription 메서드의 반환 값에 나타난 대로 관심도가 설정되어 있으며 잉크를 수집하는 태블릿에서 지원되는 패킷 속성에 대한 패킷 데이터만 반환합니다. RealTimeStylus 개체를 사용하여 잉크를 수집하는 방법에 대한 자세한 내용은 Accessing and Manipulating Stylus Input을를 참조하십시오.
RealTimeStylus 개체가 비활성화된 동안에만 SetDesiredPacketDescription 메서드를 호출할 수 있습니다. 그러나 SetDesiredPacketDescription 메서드를 호출한 결과는 GetDesiredPacketDescription 메서드의 반환 값에 즉시 반영됩니다.
다음 목록에서는 RealTimeStylus 개체에서 패킷 속성 GUID를 정렬하는 방법을 보여 줍니다.
GetDesiredPacketDescription 메서드는 배열의 처음 두 위치에 항상 PacketProperty.X 및 PacketProperty.Y GUID를 반환하며, 이전에 SetDesiredPacketDescription 메서드를 호출할 때 이러한 GUID가 지정되었는지 여부는 관계가 없습니다.
SetDesiredPacketDescription 메서드를 호출할 때 PacketProperty.PacketStatus GUID가 지정된 경우 GetDesiredPacketDescription 메서드는 PacketProperty.PacketStatus GUID를 항상 배열의 마지막 위치에 반환합니다.
SetDesiredPacketDescription 메서드를 호출할 때 두 번 이상 지정된 GUID가 있더라도 GetDesiredPacketDescription 메서드에서 반환하는 배열에는 각 GUID가 한 번씩만 나타납니다.
기본적으로 GetDesiredPacketDescription 메서드는 PacketProperty.X, PacketProperty.Y 및 PacketProperty.NormalPressure GUID를 반환합니다.
예를 들어 (a, b, a, PacketStatus, b, c, d)를 사용하여 SetDesiredPacketDescription 메서드를 호출하면 GetDesiredPacketDescription 메서드는 (X, Y, a, b, c, d, PacketStatus)를 반환합니다.
다음과 같은 경우 이 메서드는 예외를 throw합니다.
RealTimeStylus 개체가 삭제된 경우
RealTimeStylus() 생성자를 사용하여 RealTimeStylus 개체를 만든 경우
RealTimeStylus 개체가 활성화된 경우
value 매개 변수가 nullNull 참조(Visual Basic의 경우 Nothing)(Visual Basic .NET의 경우 Nothing)이거나 빈 배열이 들어 있는 경우
예제
이 Microsoft Visual C# .NET 예제는 메뉴 항목의 Click 이벤트 처리기에서 가져온 코드 조각입니다. 메뉴는 TextBox 개체인 theTextBox가 정의된 폼의 일부입니다. RealTimeStylus 개체가 활성화되어 있거나 폼에서 확인되는 패킷 속성 GUID가 없으면 이벤트 처리기가 종료됩니다. 그렇지 않으면 이벤트 처리기에서 RealTimeStylus 개체의 SetDesiredPacketDescription 메서드를 호출합니다.
using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;
// ...
// Declare the RealTimeStylus objects, the GestureRecognizer plugin,
// and the DynamicRenderer plug-in.
private Microsoft.StylusInput.RealTimeStylus thePrimaryRealTimeStylus = null;
private Microsoft.StylusInput.RealTimeStylus theSecondaryRealTimeStylus = null;
private Microsoft.StylusInput.GestureRecognizer theGestureRecognizer = null;
private Microsoft.StylusInput.DynamicRenderer theDynamicRenderer = null;
// ...
// The SetDesiredPacketDescription menu item's Click event handler
private void theMenuItemSetDesiredPacketDescription_Click(object sender,
System.EventArgs e)
{
// Can not call this method while the RealTimeStylus is enabled.
if (this.thePrimaryRealTimeStylus.Enabled)
{
MessageBox.Show("The SetDesiredPacketDescription method of the RealTimeStylus can only be called while the RealTimeStylus is disabled.");
return;
}
// Create an array of GUIDs from the checked packet properties.
ArrayList result = new ArrayList();
// ...
// Can not pass an empty array to the SetDesiredPacketDescription method.
if (0 == result.Count)
{
this.theTextBox.Text = "No PacketProperty GUID's checked. The desired packet property's of the RealTimeStylus have not been changed.";
return;
}
// Set the desired packet properties.
Guid[] theGuids = (Guid[])result.ToArray(typeof(Guid));
this.thePrimaryRealTimeStylus.SetDesiredPacketDescription(theGuids);
this.theTextBox.Text = "The desired packet property's of the RealTimeStylus have been changed.";
}
플랫폼
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원