Sdílet prostřednictvím


Using the Microsoft Gesture Recognizer Only

Using the Microsoft Gesture Recognizer Only

You can use an ink collector to access the default Microsoft gesture recognizer directly.

To use an ink collector to access the Microsoft® gesture recognizer:

  1. Set the CollectionMode property of the ink collector to either InkAndGesture (mixed mode) or GestureOnly (gesture-only mode).
  2. Choose the gestures that you want to support.
  3. Implement an event handler that receives gesture notifications. In the event handler, you need to implement the action corresponding to each event received. Note: Mixed mode supports only single-stroke gestures. Gesture mode supports multiple stroke gestures.

In mixed mode, each individual stroke is sent to the Microsoft gesture recognizer. If it is recognized as a gesture that you have enabled, an event notification is sent. If the application accepts the event notification, the stroke is erased. If the application does not accept the notification or if the stroke is not recognized to be a gesture, the stroke is stored in the Ink object.

In gesture mode, the strokes are delimited by timeouts before and after the strokes. The strokes collected within the timeout are sent to the recognizer. If the strokes are recognized as a gesture that you have enabled, an event notification is sent. The application may accept or reject the event, effecting the corresponding action or not. In gesture-only mode, the strokes are never saved in the Ink object.