Condividi tramite


Proprietà GestureRecognitionData.Count

Aggiornamento: novembre 2007

Ottiene il numero di alternative del riconoscimento disponibili per il movimento.

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

Sintassi

'Dichiarazione
Public ReadOnly Property Count As Integer
'Utilizzo
Dim instance As GestureRecognitionData
Dim value As Integer

value = instance.Count
public int Count { get; }
public:
property int Count {
    int get ();
}
/** @property */
public int get_Count()
public function get Count () : int

Valore proprietà

Tipo: System.Int32
Numero di alternative del riconoscimento disponibili per il movimento.

Esempi

Questo esempio Microsoft Visual C# .NET è un frammento dell'implementazione del metodo CustomStylusDataAdded dell'interfaccia IStylusAsyncPlugin. Il form che implementa l'interfaccia IStylusAsyncPlugin contiene un oggetto TextBox, theTextBox. Il metodo CustomStylusDataAdded verifica i dati dello stilo personalizzati dell'oggetto GestureRecognizer e visualizza informazioni su qualsiasi movimento riconosciuto dall'oggetto GestureRecognizer.

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;

// ...

// Informs the implementing object that user data is available.
public void CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data)
{
    // We can identify the kind of custom data via either the Guid or Type.
    // For the purpose of this demonstration we will validate both just to be safe.
    // For other scenarios either approach is valid.
    if (data.CustomDataId == GestureRecognizer.GestureRecognitionDataGuid)
    {
        // Cast the custom stylus data to gesture recognition data.
        GestureRecognitionData theData = data.Data as GestureRecognitionData;

        // If there is data in the notification, then display the information
        // for all of the gestures recognized.
        if (theData != null && theData.Count > 0)
        {
            this.theTextBox.Text = "GestureRecognitionData:" + Environment.NewLine;
            foreach (GestureAlternate theGesture in theData)
            {
                this.theTextBox.Text += string.Format(
                    "  Gesture {0,-10}, Confidence {1,-8}, Count {2}."
                    + Environment.NewLine, theGesture.Id,
                    theGesture.Confidence, theGesture.StrokeCount);
            }
            this.theTextBox.Text += Environment.NewLine;
        }
    }
}

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

GestureRecognitionData Classe

Membri GestureRecognitionData

Spazio dei nomi Microsoft.StylusInput.PluginData