Share via


InkCollectionMode Enumeration

InkCollectionMode Enumeration

Defines values that determine whether ink, gestures, or ink and gestures are recognized as the user writes.

Declaration

[C++]

typedef enum InkCollectionMode {
    ICM_InkOnly = 0,
    ICM_GestureOnly = 1,
    ICM_InkAndGesture = 2
} InkCollectionMode;

[Microsoft® Visual Basic® 6.0]

Enum InkCollectionMode
    ICM_InkOnly = 0
    ICM_GestureOnly = 1
    ICM_InkAndGesture = 2
End Enum

Members

The following tables list the enumeration values.

Name Description
InkOnly Collects only ink, creating a stroke.

The Gesture event interest is set to False, meaning that gestures are not collected (all other event interests remain as they were).

GestureOnly Collects only gestures and does not create a stroke. Gestures can be either single or multi-stroke. Multi-stroke gestures are accepted if the strokes are made within the time set by the built-in timer of the recognizer.

All stroke-related and packet-related events do not fire from the InkCollector. Cursor events do fire, and ink is always deleted.

The Gesture event interest is set to True, meaning that gestures are collected (all other event interests remain as they were).

InkAndGesture Accepts only single-stroke gestures. The Gesture event fires first, giving the user the ability to say Cancel = True or False. The default is True, except when NoGesture is the primary gesture, Cancel defaults to False. If True, the ink is a gesture and is deleted. If False, the gesture is ink and a Stroke event fires.

The Gesture event interest is set to True (all other event interests are kept as they were).

Remarks

If a user attempts a right-click and moves the pen when in InkOnly or InkAndGesture mode, ink flows from the pen tip. When handling the Stroke event, you should erase the ink that flowed as a result of the pen movement.

When the CollectionMode is set to GestureOnly (set through the CollectionMode property), the timeout between when a user adds a gesture and when the Gesture event occurs is a fixed value that cannot be altered programmatically. Gesture recognition is faster in InkAndGesture mode. To prevent the collection of ink while in InkAndGesture mode, you can:

  • Set CollectionMode to InkAndGesture.
  • In the Stroke event, delete the stroke.
  • In the Gesture event, process the gesture.
  • Set DynamicRendering to False.

When using this enumeration with the InkPicture control, or the InkCollector or InkOverlay objects, on a system that has the Microsoft Windows® XP Tablet PC Edition Software Development Kit (SDK) installed but that doesn't have recognizers, the mode cannot be set to GestureOnly or InkAndGesture.

The ink collector always creates either a stroke (InkOnly mode) or a gesture (GestureOnly mode) and sometimes created both (InkAndGesture mode).

Typical scenarios for each mode follow.

Unwanted behavior might occur when the CollectionMode property is set to InkAndGesture and the interest of an object or control in a known gesture is set (by calling the SetGestureStatus method). If a user draws ink that resembles a gesture that is in the recognizer's list of alternates, the Gesture event fires and ink disappears, even if the gesture is not the top alternate. To prevent the ink from disappearing and cancel collection of the gesture, set Cancel to True if the event is one to which you do not want the recognizer to respond.