Condividi tramite


Metodo RealTimeStylus.GetTabletFromTabletContextId

Aggiornamento: novembre 2007

Restituisce l'oggetto Tablet associato a un identificatore di contesto della tavoletta specificato.

Spazio dei nomi:  Microsoft.StylusInput
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
Public Function GetTabletFromTabletContextId ( _
    tabletContextId As Integer _
) As Tablet
'Utilizzo
Dim instance As RealTimeStylus
Dim tabletContextId As Integer
Dim returnValue As Tablet

returnValue = instance.GetTabletFromTabletContextId(tabletContextId)
public Tablet GetTabletFromTabletContextId(
    int tabletContextId
)
public:
Tablet^ GetTabletFromTabletContextId(
    int tabletContextId
)
public Tablet GetTabletFromTabletContextId(
    int tabletContextId
)
public function GetTabletFromTabletContextId(
    tabletContextId : int
) : Tablet

Parametri

  • tabletContextId
    Tipo: System.Int32
    Identificatore di contesto della tavoletta per il quale si desidera l'oggetto Tablet associato.

Valore restituito

Tipo: Microsoft.Ink.Tablet
Oggetto Tablet associato a un identificatore di contesto della tavoletta specificato.

Note

Nota

Un identificatore di contesto della tavoletta è specifico dell'oggetto RealTimeStylus; tuttavia due oggetti RealTimeStylus possono disporre di identificatori di contesto diversi per lo stesso oggetto Tablet. Inoltre, un identificatore di contesto della tavoletta è valido solo mentre è abilitato un oggetto RealTimeStylus. Se un oggetto RealTimeStylus viene disabilitato, quindi nuovamente abilitato, l'identificatore di contesto della tavoletta per ogni oggetto Tablet può disporre di un valore diverso rispetto al momento in cui l'oggetto RealTimeStylus era stato abilitato per la prima volta.

Il metodo genera un'eccezione quando RealTimeStylus viene disabilitato o eliminato.

Nota

Se chiamata all'interno di alcuni gestori di messaggi è possibile che questa funzione venga reimmessa, provocando 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 C# è un frammento tratto dall'implementazione del metodo RealTimeStylusEnabled dell'interfaccia IStylusAsyncPlugin. Il form che implementa l'interfaccia IStylusAsyncPlugin contiene un oggetto TextBox, theTextBox. Nel metodo RealTimeStylusEnabled vengono visualizzate informazioni sulle tavolette disponibili al momento dell'abilitazione dell'oggetto RealTimeStylus.

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;

// ...

// Called when the RealTimeStylus is enabled, or when the plug-in is added to
// a RealTimeStylus that is already enabled.
public void RealTimeStylusEnabled(RealTimeStylus sender,
    RealTimeStylusEnabledData data)
{
    // Display the list of available tablets.
    this.theTextBox.Text = string.Format(
        "RealTimeStylus enabled ({0} tablets attached):" + Environment.NewLine,
        data.Count);
    foreach (int theContextId in data)
    {
        Tablet theTablet =
            this.thePrimaryRealTimeStylus.GetTabletFromTabletContextId(theContextId);

        this.theTextBox.Text += string.Format(
            "  ContextId = {0}, Tablet.Name = {1}" + Environment.NewLine,
            theContextId, theTablet.Name);

        this.theTextBox.Text += "   Available packet properties:" + Environment.NewLine;

        foreach(TabletPropertyDescription theTabletPropertyDescription in
            this.thePrimaryRealTimeStylus.GetTabletPropertyDescriptionCollection(theContextId))
        {
            this.theTextBox.Text += string.Format("    {0}" + Environment.NewLine,
                this.GetPacketPropertyNameFromGuid(theTabletPropertyDescription.PacketPropertyId));
        }
    }
}

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

Vedere anche

Riferimenti

RealTimeStylus Classe

Membri RealTimeStylus

Spazio dei nomi Microsoft.StylusInput

Stylus.TabletContextId

RealTimeStylus.GetTabletContextIdFromTablet