RealTimeStylus.WindowInputRectangle - свойство
Обновлен: Ноябрь 2007
Gets or sets the input rectangle for the RealTimeStylus object.
Пространство имен: 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
The input rectangle for the RealTimeStylus object, in pixels.
Value |
Meaning |
---|---|
(0, 0, 0, 0) |
The input rectangle maps to the window bounds. |
System.Drawing.Rectangle |
The input rectangle maps to the Rectangle object. |
Заметки
The input region is the intersection of the window bounds and the value of this property. When this property is set to the empty rectangle, the RealTimeStylus object collects over the whole window, even when the window is resized.
Once the RealTimeStylus object starts collecting tablet pen data, it continues to collect the data until the stylus is raised, even if the stylus is moved outside of the input region. You can choose to handle tablet pen data that is collected outside of the input region differently in either an attached IStylusSyncPlugin object or the attached IStylusAsyncPlugin object.
This property throws an exception under the following conditions.
The RealTimeStylus object is disposed.
This property is set on a RealTimeStylus object that was created with the RealTimeStylus() constructor.
Примечание. |
---|
Setting or getting the property can cause a reentrant call when used within certain message handlers, causing unexpected results. Take care to avoid a reentrant call when handling any of the following messages: WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_PAINT; WM_SYSCOMMAND if wParam is set to SC_HOTKEY or SC_TASKLIST; and WM_SYSKEYDOWN (when processing Alt-Tab or Alt-Esc key combinations). This is an issue with single-threaded apartment model applications. |
Примеры
This Microsoft Visual C# .NET example is a snippet from a form's Load event handler, which creates a GestureRecognizer, DynamicRenderer, and two RealTimeStylus objects, attaches the objects in a cascaded RealTimeStylus model, and enables dynamic rendering, gesture recognition, and tablet pen data collection through the RealTimeStylus object. The GestureRecognizer object is set to recognize single-stroke gestures and to recognize only the ApplicationGesture, ApplicationGesture, and ApplicationGesture application gesture. The primary RealTimeStylus object's WindowInputRectangle property is explicitly set to use the entire control to which the RealTimeStylus object is attached. The form itself implements the IStylusAsyncPlugin interface and is attached to the RealTimeStylus object.
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 с пакетом обновления 2 (SP2), Windows Server 2003
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0