다음을 통해 공유


RealTimeStylus.WindowInputRectangle 속성

업데이트: 2007년 11월

RealTimeStylus 개체의 입력 사각형을 가져오거나 설정합니다.

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

구문

‘선언
Public Property WindowInputRectangle As Rectangle
‘사용 방법
Dim instance As RealTimeStylus
Dim value As Rectangle

value = instance.WindowInputRectangle

instance.WindowInputRectangle = value
public Rectangle WindowInputRectangle { get; set; }
public:
property Rectangle WindowInputRectangle {
    Rectangle get ();
    void set (Rectangle value);
}
/** @property */
public Rectangle get_WindowInputRectangle()
/** @property */
public  void set_WindowInputRectangle(Rectangle value)
public function get WindowInputRectangle () : Rectangle
public function set WindowInputRectangle (value : Rectangle)

속성 값

형식: System.Drawing.Rectangle
RealTimeStylus 개체의 입력 사각형(픽셀 단위)입니다.

의미

(0, 0, 0, 0)

입력 사각형이 창 경계에 매핑됩니다.

System.Drawing.Rectangle

입력 사각형이 Rectangle 개체에 매핑됩니다.

설명

입력 영역은 창 경계와 이 속성 값의 교집합입니다. 이 속성을 빈 사각형으로 설정하면 창의 크기가 조정된 경우에도 RealTimeStylus 개체가 전체 창에서 데이터를 수집합니다.

RealTimeStylus 개체에서 태블릿 펜 데이터를 수집하기 시작하면 스타일러스가 입력 영역을 벗어나도 스타일러스를 들어올릴 때까지 데이터가 계속 수집됩니다. 입력 영역 외부에서 수집된 태블릿 펜 데이터를 연결된 IStylusSyncPlugin 개체나 연결된 IStylusAsyncPlugin 개체에서 다르게 처리할 수 있습니다.

다음과 같은 경우 이 속성은 예외를 throw합니다.

참고

특정 메시지 처리기 내에서 이 속성을 설정하거나 가져오면 재진입 호출이 발생하여 예기치 않은 결과가 나타납니다. WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_PAINT, WM_SYSKEYDOWN(Alt+Tab 또는 Alt+Esc 키 조합을 처리하는 경우) 메시지 중 하나를 처리할 때는 재진입 호출이 발생하지 않도록 주의해야 합니다. wParam이 SC_HOTKEY 또는 SC_TASKLIST로 설정된 경우에는 WM_SYSCOMMAND도 여기에 해당합니다. . 이는 단일 스레드 아파트 모델 응용 프로그램에 적용되는 문제입니다.

예제

이 Microsoft Visual C# .NET 예제는 폼의 Load 이벤트 처리기에서 가져온 코드 조각입니다. 이 이벤트 처리기는 GestureRecognizer, DynamicRenderer 및 두 RealTimeStylus 개체를 만들고 개체를 계단식 RealTimeStylus 모델에 연결한 다음 RealTimeStylus 개체를 통한 동적 렌더링, 제스처 인식 및 태블릿 펜 데이터 수집을 활성화합니다. 단일 스트로크 제스처를 인식하고 ApplicationGesture, ApplicationGesture, and ApplicationGesture 응용 프로그램 제스처만 인식하도록 GestureRecognizer 개체를 설정합니다. 주 RealTimeStylus 개체의 WindowInputRectangle 속성을 명시적으로 설정하여 RealTimeStylus 개체가 연결된 전체 컨트롤을 사용합니다. 폼은 자체적으로 IStylusAsyncPlugin 인터페이스를 구현하며 RealTimeStylus 개체에 연결됩니다.

using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;

// ...

// The panel where the tablet pen data is collected.
private System.Windows.Forms.Panel thePanel;

// 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 form's Load event handler.
private void theForm_Load(object sender, System.EventArgs e)
{
    // ...

    // Create a DynamicRenderer attached to the drawing area ,
    // and enable dynamic rendering.
    this.theDynamicRenderer = new DynamicRenderer(this.thePanel);
    this.theDynamicRenderer.Enabled = true;

    // Create a GestureRecognizer, and set it to recognize single-stroke gestures.
    this.theGestureRecognizer = new GestureRecognizer();
    this.theGestureRecognizer.MaxStrokeCount = 1;

    // Allow gesture recognition for specific gestures.
    this.theGestureRecognizer.EnableGestures( new ApplicationGesture[]
        {
            ApplicationGesture.Right,
            ApplicationGesture.ChevronRight,
            ApplicationGesture.ArrowRight
        } );

    // Enable gesture recognition.
    this.theGestureRecognizer.Enabled = true;

    // Create the primary and secondary RealTimeStylus objects.
    this.thePrimaryRealTimeStylus = new RealTimeStylus(this.thePanel);
    this.theSecondaryRealTimeStylus = new RealTimeStylus();

    // Add the secondary RealTimeStylus to the primary's asynchronous plug-in collection.
    this.thePrimaryRealTimeStylus.AsyncPluginCollection.Add(
        this.theSecondaryRealTimeStylus);

    // Add the dynamic renderer to the primary's synchronous plug-in collection.
    this.thePrimaryRealTimeStylus.SyncPluginCollection.Add(this.theDynamicRenderer);

    // Add the gesture recognizer to the secondary's synchronous plug-in collection.
    this.theSecondaryRealTimeStylus.SyncPluginCollection.Add(this.theGestureRecognizer);

    // Add the form to the secondary's asynchronous plug-in colleciton.
    this.theSecondaryRealTimeStylus.AsyncPluginCollection.Add(this);

    // Set the input rectangle to the entire panel for the RealTimeStylus.
    this.thePrimaryRealTimeStylus.WindowInputRectangle = new Rectangle(0,0,0,0);

    // Enable the RealTimeStylus, which allows notifications to flow to the plug-ins.
    this.thePrimaryRealTimeStylus.Enabled = true;

    // ...
}

플랫폼

Windows Vista, Windows XP SP2, Windows Server 2003

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

RealTimeStylus 클래스

RealTimeStylus 멤버

Microsoft.StylusInput 네임스페이스