Proprietà RealTimeStylus.WindowInputRectangle
Aggiornamento: novembre 2007
Ottiene o imposta il rettangolo di input dell'oggetto RealTimeStylus.
Spazio dei nomi: Microsoft.StylusInput
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Sintassi
'Dichiarazione
Public Property WindowInputRectangle As Rectangle
'Utilizzo
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)
Valore proprietà
Tipo: System.Drawing.Rectangle
Rettangolo di input dell'oggetto RealTimeStylus, in pixel.
Valore |
Significato |
---|---|
(0, 0, 0, 0) |
Il rettangolo di input esegue il mapping ai limiti della finestra. |
System.Drawing.Rectangle |
Il rettangolo di input esegue il mapping all'oggetto Rectangle. |
Note
L'area di input è l'intersezione dei limiti della finestra e del valore di questa proprietà. Quando questa proprietà viene impostata sul rettangolo vuoto, l'oggetto RealTimeStylus esegue la raccolta sull'intera finestra, anche quando quest'ultima viene ridimensionata.
Dopo avere avviato la raccolta dei dati della penna del Tablet PC, l'oggetto RealTimeStylus continua a raccogliere i dati finché non viene sollevato lo stilo, anche se lo stilo viene spostato all'esterno dell'area di input. È possibile scegliere di gestire i dati della penna del Tablet PC raccolti all'esterno dell'area di input in modi diversi in un oggetto IStylusSyncPlugin associato o nell'oggetto IStylusAsyncPlugin associato.
Questa proprietà genera un'eccezione nelle condizioni seguenti.
L'oggetto RealTimeStylus viene eliminato.
Questa proprietà è impostata su un oggetto RealTimeStylus creato con il costruttore RealTimeStylus().
Nota
Il fatto di impostare o ottenere la proprietà può provocare una chiamata rientrante se utilizzata all'interno di determinati gestori di messaggi, generando risultati imprevisti. Prestare attenzione per evitare una chiamata rientrante durante la gestione di uno dei messaggi seguenti: WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_PAINT, WM_SYSCOMMAND se wParam è impostato su SC_HOTKEY o SC_TASKLIST e WM_SYSKEYDOWN (durante l'elaborazione delle combinazioni di tasti ALT-TAB o ALT-ESC). Questo problema è relativo alle applicazioni con modello di apartment a thread singolo.
Esempi
Questo esempio Microsoft Visual C# .NET è un frammento tratto dal gestore dell'evento Load di un form che crea un oggetto GestureRecognizer, DynamicRenderer e due oggetti RealTimeStylus, associa gli oggetti in un modello RealTimeStylus sovrapposto e abilita il rendering dinamico, il riconoscimento del movimento e la raccolta dei dati della penna del Tablet PC tramite RealTimeStylus. L'oggetto GestureRecognizer viene impostato per il riconoscimento di movimenti a tratto singolo e per il riconoscimento del movimento dell'applicazioneApplicationGesture, ApplicationGesture e ApplicationGesture. La proprietà WindowInputRectangle dell'oggetto RealTimeStylus primario viene impostata in modo esplicito per utilizzare l'intero controllo a cui è associato l'oggetto RealTimeStylus. Il form stesso implementa l'interfaccia IStylusAsyncPlugin ed è associato all'oggetto 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;
// ...
}
Piattaforme
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.
Informazioni sulla versione
.NET Framework
Supportato in: 3.0