Поделиться через


InkCollectorGestureEventHandler - делегат

Обновлен: Ноябрь 2007

Represents the method that handles the Gesture event of an InkCollector object.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Delegate Sub InkCollectorGestureEventHandler ( _
    sender As Object, _
    e As InkCollectorGestureEventArgs _
)
'Применение
Dim instance As New InkCollectorGestureEventHandler(AddressOf HandlerMethod)
public delegate void InkCollectorGestureEventHandler(
    Object sender,
    InkCollectorGestureEventArgs e
)
public delegate void InkCollectorGestureEventHandler(
    Object^ sender, 
    InkCollectorGestureEventArgs^ e
)
/** @delegate */
public delegate void InkCollectorGestureEventHandler(
    Object sender,
    InkCollectorGestureEventArgs e
)
JScript не поддерживает делегаты.

Параметры

Заметки

The Gesture event occurs when the user performs a predefined application gesture with the pen, which is recognized by an application gesture recognizer.

When you create an InkCollectorGestureEventHandler delegate, you identify the method that handles the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

When the CollectionMode property is set to GestureOnly, the timeout between when a user adds a gesture and when the Gesture event occurs is a fixed value that you cannot alter programmatically. Gesture recognition is faster in InkAndGesture mode.

To prevent the collection of ink while in InkAndGesture mode:

To prevent the flow of ink while gesturing, set the DynamicRendering property to false.

ms573448.alert_note(ru-ru,VS.90).gifПримечание.

To recognize gestures, you must use an object or control that can collect ink.

ms573448.alert_note(ru-ru,VS.90).gifПримечание.

The InkCollector object, the InkOverlay object, and the InkPicture control use the InkCollectorGestureEventHandler delegate to add a Gesture event handler.

Примеры

The event handler in this example displays application gesture information on a status bar label, statusLabelAppGesture.

Private Sub Event_OnApplicationGesture(ByVal sender As Object, ByVal e As InkCollectorGestureEventArgs)

    ' There might be more than one gesture passed in InkCollectorGestureEventArgs
    ' The gestures are arranged in order of confidence from most to least
    ' This event handler is only concerned with the first (most confident) gesture
    Dim G As Gesture = e.Gestures(0)

    ' we will use the gesture if it has confidence of strong or intermediate

    If G.Confidence = RecognitionConfidence.Intermediate Or _
    G.Confidence = RecognitionConfidence.Strong Then

        Select Case G.Id
            Case ApplicationGesture.Left
                statusLabelAppGesture.Text = "Left"
            Case ApplicationGesture.Right
                statusLabelAppGesture.Text = "Right"
            Case ApplicationGesture.Up
                statusLabelAppGesture.Text = "Up"
            Case ApplicationGesture.Down
                statusLabelAppGesture.Text = "Down"
        End Select

    End If
End Sub
void Event_OnApplicationGesture(object sender, InkCollectorGestureEventArgs e)
{
    // There might be more than one gesture passed in InkCollectorGestureEventArgs
    // The gestures are arranged in order of confidence from most to least
    // This event handler is only concerned with the first (most confident) gesture
    Gesture G = e.Gestures[0];

    // we will use the gesture if it has confidence of strong or intermediate

    if (G.Confidence == RecognitionConfidence.Intermediate ||
        G.Confidence == RecognitionConfidence.Strong)
    {

        switch (G.Id)
        {
            case ApplicationGesture.Left:
                statusLabelAppGesture.Text = "Left";
                break;
            case ApplicationGesture.Right:
                statusLabelAppGesture.Text = "Right";
                break;
            case ApplicationGesture.Up:
                statusLabelAppGesture.Text = "Up";
                break;
            case ApplicationGesture.Down:
                statusLabelAppGesture.Text = "Down";
                break;
        }
    }

}

Only application gestures in which you have expressed an interest will fire this event. In this example, the InkCollector object, mInkCollector expresses an interest in four gestures of the ApplicationGesture enumeration.

' set InkCollector interest in the Left, Right, Up, Down gestures
mInkCollector.SetGestureStatus(ApplicationGesture.Left, True)
mInkCollector.SetGestureStatus(ApplicationGesture.Right, True)
mInkCollector.SetGestureStatus(ApplicationGesture.Up, True)
mInkCollector.SetGestureStatus(ApplicationGesture.Down, True)
// set InkCollector interest in the Left, Right, Up, Down gestures
mInkCollector.SetGestureStatus(ApplicationGesture.Left, true);
mInkCollector.SetGestureStatus(ApplicationGesture.Right, true);
mInkCollector.SetGestureStatus(ApplicationGesture.Up, true);
mInkCollector.SetGestureStatus(ApplicationGesture.Down, true);

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

Microsoft.Ink - пространство имен

ApplicationGesture

InkCollector.SetGestureStatus