Gesture.Id Property
Gesture.Id Property |
Gets the value of the application gesture.
Visual Basic .NET Public ReadOnly Property Id As ApplicationGesture C# public ApplicationGesture Id { get; } Managed C++ public: __property ApplicationGesture* get_Id();
Microsoft.Ink.ApplicationGesture. The value of the application gesture.
This property is read-only. This property has no default value.
AllGestures
0Recognizes all application-specific gestures. NoGesture
61440Recognizes no application-specific gestures. Scratchout
61441Erases content. This gesture requires at least three strokes in a back-and-forth direction. Triangle
61442Inserts input. The triangle must be drawn in a single stroke, without lifting the pen. Square
61443Marks an action item. The square can be drawn in one or two strokes. In one stroke, draw the entire square without lifting the pen. In two strokes, draw three sides of the square and use another stroke to draw the remaining side. Do not use more than two strokes to draw the square. Star
61444Marks an action item. The star must have exactly five points and be drawn in a single stroke without lifting the pen. Check
61445Denotes a check-off. The upward stroke must be twice as long as the smaller downward stroke. Curlicue
61456Cuts a word. Start the curlicue on the word you intend to cut. DoubleCurlicue
61457Copies a word. Start the double-curlicue on the word you intend to copy. Circle
61472Has no suggested semantic behavior or action. The circle must be drawn in a single stroke without lifting the pen. DoubleCircle
61473Pastes a selection. The two circles must overlap each other and be drawn in a single stroke without lifting the pen. SemiCircleLeft
61480Undoes an action. The semicircle must be drawn from left to right. The two ends of the semicircle should be as horizontally even as possible . SemiCircleRight
61481Redoes an action. The semicircle must be drawn from right to left. The two ends of the semicircle should be as horizontally even as possible. ChevronUp
61488Has no suggested semantic behavior or action. Both sides of the chevron must be drawn as equal as possible. The angle must be sharp and end in a point. ChevronDown
61489Has no suggested semantic behavior or action. Both sides of the chevron must be drawn as equal as possible. The angle must be sharp and end in a point. ChevronLeft
61490Has no suggested semantic behavior or action. Both sides of the chevron must be drawn as equal as possible. The angle must be sharp and end in a point. ChevronRight
61491Has no suggested semantic behavior or action. Both sides of the chevron must be drawn as equal as possible. The angle must be sharp and end in a point. ArrowUp
61496Has no suggested semantic behavior or action. The arrow can be drawn in single stroke or in two strokes where one stroke is the line and the other is the arrow head. Do not use more than two strokes to draw the arrow. ArrowDown
61497Has no suggested semantic behavior or action. The arrow can be drawn in a single stroke or in two strokes where one stroke is the line and the other is the arrow head. Do not use more than two strokes to draw the arrow. ArrowLeft
61498Has no suggested semantic behavior or action. The arrow can be drawn in a single stroke or in two strokes where one stroke is the line and the other is the arrow head. Do not use more than two strokes to draw the arrow. ArrowRight
61499Has no suggested semantic behavior or action. The arrow can be drawn in a single stroke or in two strokes where one stroke is the line and the other is the arrow head. Do not use more than two strokes to draw the arrow. Up
61528Has no suggested semantic behavior or action. This gesture must be drawn as a single fast flick in the upward direction. Down
61529Has no suggested semantic behavior or action. This gesture must be drawn as a single fast flick in the downward direction. Left
61530Specifies a backspace. This gesture must be drawn as a single fast flick to the left. Right
61531Signifies a space. This gesture must be drawn as a single fast flick to the right. UpDown
61536Undoes an action. This gesture must be drawn in a single stroke starting with the up stroke. The two strokes must be as close to each other as possible. DownUp
61537Has no suggested semantic behavior or action. This gesture must be drawn in a single stroke starting with the down stroke. The two strokes must be as close to each other as possible. LeftRight
61538Cuts a selection. This gesture must be drawn in a single stroke starting with the left stroke. The two strokes must be as close to each other as possible. RightLeft
61539Copies a selection. This gesture must be drawn in a single stroke starting with the right stroke. The two strokes must be as close to each other as possible. UpLeftLong
61540Decreases the indent. This gesture must be drawn in a single stroke starting with the up stroke. The left stroke must be about twice as long as the up stroke, and the two strokes must be at a right angle. UpRightLong
61541Signifies pressing a TAB key. This gesture must be drawn in a single stroke starting with the up stroke. The right stroke must be about twice as long as the up stroke, and the two strokes must be at a right angle. DownLeftLong
61542Signifies pressing an ENTER key. This gesture must be drawn in a single stroke starting with the down stroke. The left stroke is about twice as long as the up stroke, and the two strokes must be at a right angle. DownRightLong
61543Signifies pressing the spacebar. This gesture must be drawn in a single stroke starting with the down stroke. The right stroke must be about twice as long as the up stroke, and the two strokes must be at a right angle. UpLeft
61544Has no suggested semantic behavior or action. This gesture must be drawn in a single stroke starting with the up stroke. The two sides must be as equal in length as possible and at a right angle. UpRight
61545Has no suggested semantic behavior or action. This gesture must be drawn in a single stroke starting with the up stroke. The two sides must be as equal in length as possible and at a right angle. DownLeft
61546Has no suggested semantic behavior or action. This gesture must be drawn in a single stroke starting with the down stroke. The two sides must be as equal in length as possible and at a right angle. DownRight
61547Has no suggested semantic behavior or action. This gesture must be drawn in a single stroke starting with the down stroke. The two sides must be as equal in length as possible and at a right angle. LeftUp
61548Has no suggested semantic behavior or action. This gesture must be drawn in a single stroke starting with the left stroke. The two sides must be as equal in length as possible and at a right angle. LeftDown
61549Has no suggested semantic behavior or action. This gesture must be drawn in a single stroke starting with the left stroke. The two sides are as equal in length as possible and at a right angle. RightUp
61550Signifies an Input Method Editor (IME) convert. This gesture must be drawn in a single stroke starting with the right stroke. The two sides must be as equal in length as possible and at a right angle. RightDown
61551Has no suggested semantic behavior or action. This gesture must be drawn in a single stroke starting with the right stroke. The two sides must be as equal in length as possible and at a right angle. Exclamation
61604Has no suggested semantic behavior or action. The line must be drawn first and then the dot drawn quickly and as close to the line as possible. Tap
61680Signifies a mouse click. For the least amount of slippage, the tap must be made quickly. DoubleTap
61681Signifies a mouse double-click. The two taps must be made quickly to result in the least amount of slippage and the least duration between taps. In addition, the taps must be as close to each other as possible.
Note: A Gesture object's identifier is constant over time, meaning that it never changes.Because each application gesture exists as a value in the ApplicationGesture enumeration, that value serves as the ID of that gesture.
[C#]
This C# example reports gesture information in a status bar and draws a small circle around the location of the hot point of the gesture.
using System; using System.Drawing; using System.Windows.Forms; using Microsoft.Ink; public class CSGestureForm : System.Windows.Forms.Form { private System.Windows.Forms.StatusBar theGestureStatusBar; private InkCollector theInkCollector; private Point theHotPoint; public CSGestureForm() { // Initialize the form with a status bar at the bottom. theGestureStatusBar = new System.Windows.Forms.StatusBar(); SuspendLayout(); theGestureStatusBar.Location = new System.Drawing.Point(0, 244); theGestureStatusBar.Size = new System.Drawing.Size(300, 22); theGestureStatusBar.Text = ""; ClientSize = new System.Drawing.Size(300, 266); Controls.AddRange(new System.Windows.Forms.Control[] {this. theGestureStatusBar }); Text = "Gesture Test Application"; Paint += new System.Windows.Forms.PaintEventHandler(this.CSGestureForm_Paint); this.BackColor = Color.LightGray; ResumeLayout(false); // Give the hot spot an initial value. theHotPoint = new Point(-1, -1); // Initialize the InkCollector object. theInkCollector = new InkCollector(Handle); theInkCollector.CollectionMode = CollectionMode.GestureOnly; theInkCollector.SetGestureStatus(ApplicationGesture.Check, true); theInkCollector.Gesture += new InkCollectorGestureEventHandler(Gesture_Event); theInkCollector.Enabled = true; } static void Main() { Application.Run(new CSGestureForm()); } private void Gesture_Event(object sender, InkCollectorGestureEventArgs e) { // Get information about the first gesture returned. Gesture theGesture = e.Gestures[0]; // Save the hot point information for painting. theHotPoint = theGesture.HotPoint; // Write the gesture type and confidence on the status bar. theGestureStatusBar.Text = theGesture.Id +" "+ theGesture.Confidence; Refresh(); } private void CSGestureForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; // Transform hotspot from HIMETRIC to window coordinates. theInkControl.Renderer.InkSpaceToPixel(g, ref theHotPoint); // Draw a little circle around the hot spot. g.DrawEllipse(Pens.Orange, theHotPoint.X-4, theHotPoint.Y-4, 9, 9); g.Dispose(); } // Event handler for the form's closed event private void CSGestureForm_Closed(object sender, System.EventArgs e) { theInkCollector.Dispose(); theInkCollector = null; } }[VB.NET]
This Microsoft® Visual Basic® .NET example reports gesture information in a status bar and draws a small circle around the location of the hot point of the gesture.
Imports System.Drawing Imports Microsoft.Ink Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " 'This contains the default form code, plus a status bar, StatusBar1. #End Region Dim theInkCollector As InkCollector Dim theHotPoint As System.Drawing.Point Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load theHotPoint = New Point(-1, -1) theInkCollector = New InkCollector(Handle) theInkCollector.CollectionMode = CollectionMode.GestureOnly theInkCollector.SetGestureStatus(ApplicationGesture.Check, True) AddHandler theInkCollector.Gesture, AddressOf Gesture_Event theInkCollector.Enabled = True End Sub Private Sub Gesture_Event( _ ByVal sender As Object, _ ByVal e As InkCollectorGestureEventArgs) 'Get information about the first gesture returned. Dim theGesture As Gesture = e.Gestures(0) 'Save the hot point information for painting. theHotPoint = theGesture.HotPoint 'Write the gesture type and confidence on the status bar. StatusBar1.Text = theGesture.Id.ToString() & _ " " & theGesture.Confidence.ToString() Refresh() End Sub Private Sub Form1_Paint( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.PaintEventArgs) _ Handles MyBase.Paint Dim g As Graphics = e.Graphics 'Convert from ink to window coordinates and draw a circle. theInkCollector.Renderer.InkSpaceToPixel(g, theHotPoint) g.DrawEllipse(Pens.Red, theHotPoint.X - 4, theHotPoint.Y - 4, 9, 9) End Sub 'Event handler for the form's closed event Private Sub Form1_Closed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed theInkCollector.Dispose() Set theInkCollector = Nothing End Sub End Class