Bagikan melalui


CollectionMode Enumeration

CollectionMode Enumeration

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

Definition

Visual Basic .NET Public Enum CollectionMode
C# public enum CollectionMode
Managed C++ __value public enum CollectionMode

Constants

Constant Name Description
InkOnly

Collects only ink, creating a stroke.

The InkCollector.Gesture, InkOverlay.Gesture, or InkPicture.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 object, InkOverlay object, or InkPicture control. Cursor events fire, and ink is always deleted.

The InkCollector.Gesture, InkOverlay.Gesture, or InkPicture.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 InkCollector.Gesture, InkOverlay.Gesture, or InkPicture.Gesture event fires first, allowing you to cancel or accept the event. The default is to accept the event, except when NoGesture is the primary gesture. If the gesture is accepted, the ink is deleted. If the gesture is canceled, the stroke is not deleted and a InkCollector.Stroke, InkOverlay.Stroke, or InkPicture.Stroke event fires.

The InkCollector.Gesture, InkOverlay.Gesture, or InkPicture.Gesture event interest is set to true, meaning that gestures are collected (all other event interests remain as they were).

Remarks

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

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

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 does not have recognizers installed, the mode cannot be set to GestureOnly or InkAndGesture.

Typical scenarios for each collection mode follow.

Note: If the cursor does not move out of range of the collection object between strokes, the cursor in range and the cursor out of range events do not fire.

Note: Either single- or multi-stroke gestures are accepted in this mode.

Note: Only single-stroke gestures are accepted in this mode.

Unwanted behavior might occur when the InkCollector.CollectionMode, InkOverlay.CollectionMode, or InkPicture.CollectionMode property is set to InkAndGesture and the interest of an object or control in a known gesture is set (by calling the InkCollector.SetGestureStatus, InkOverlay.SetGestureStatus, or InkPicture.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 to cancel collection of the gesture, set the inherited Cancel Leave Site property of the InkCollectorGestureEventArgs to true if you do not want the recognizer to respond to that event.

Enumeration Information

Namespace Microsoft.Ink
Assembly Microsoft.Ink (microsoft.ink.dll)
Strong Name Microsoft.Ink, Version=1.7.4009.0, Culture=neutral, PublicKeyToken=a2870d9cc4d021c8

See Also