Beispiel #1
0
        }// end miniPadForm constructor

        void mo_Gesture(object sender, InkCollectorGestureEventArgs e)
        {
            ApplicationGesture gestureID = e.Gestures[0].Id;
            string             location  = e.Gestures[0].HotPoint.ToString();


            System.Windows.Forms.MessageBox.Show("Your gesture was: " + gestureID.ToString() + " at " + location);
            switch (gestureID)
            {
            case ApplicationGesture.ArrowDown:
                pptController.nextSlide();
                break;

            case ApplicationGesture.ArrowUp:
                pptController.prevSlide();
                break;

            case ApplicationGesture.ChevronDown:
                pptController.newSlide();
                break;

            default:
                break;
            }
        } // end mo_gesture method
Beispiel #2
0
        void Event_OnApplicationGesture(object sender, InkCollectorGestureEventArgs e)
        {
            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:
                        MessageBox.Show("Left");
                        break;
                    case ApplicationGesture.Right:
                        MessageBox.Show("Right");
                        break;
                    case ApplicationGesture.Up:
                        MessageBox.Show("Up");
                        break;
                    case ApplicationGesture.Down:
                        MessageBox.Show("Down");
                        break;
                    case ApplicationGesture.Check:
                        MessageBox.Show("Check");
                        break;
                }
            }
        }
Beispiel #3
0
 private void inkCanvas_Gesture(object sender, InkCollectorGestureEventArgs e)
 {
     switch(e.Gesture.Id)
     {
         case ApplicationGesture.Right:
             Debug.Print("Right");
             break;
         case ApplicationGesture.UpRight:
             Debug.Print("UpRight");
             break;
         case ApplicationGesture.Up:
             Debug.Print("Up");
             break;
         case ApplicationGesture.UpLeft:
             Debug.Print("UpLeft");
             break;
         case ApplicationGesture.Left:
             Debug.Print("Left");
             break;
         case ApplicationGesture.DownLeft:
             Debug.Print("DownLeft");
             break;
         case ApplicationGesture.Down:
             Debug.Print("Down");
             break;
         case ApplicationGesture.DownRight:
             Debug.Print("DownRight");
             break;
         default:
             Debug.Print("Unknown");
             break;
     }
 }
        private void inkCanvas_Gesture(object sender, InkCollectorGestureEventArgs e)
        {
            switch (e.Gesture.Id)
            {
            case ApplicationGesture.Right:
                Debug.Print("Right");
                break;

            case ApplicationGesture.UpRight:
                Debug.Print("UpRight");
                break;

            case ApplicationGesture.Up:
                Debug.Print("Up");
                break;

            case ApplicationGesture.UpLeft:
                Debug.Print("UpLeft");
                break;

            case ApplicationGesture.Left:
                Debug.Print("Left");
                break;

            case ApplicationGesture.DownLeft:
                Debug.Print("DownLeft");
                break;

            case ApplicationGesture.Down:
                Debug.Print("Down");
                break;

            case ApplicationGesture.DownRight:
                Debug.Print("DownRight");
                break;

            default:
                Debug.Print("Unknown");
                break;
            }
        }
Beispiel #5
0
        private void DeleteInsideRectangle(Stroke s, Rectangle r, InkCollectorGestureEventArgs e)
        {
            // Se buscan los strokes que tengan al menos un 60% en el boundingbox
            Strokes borrarStrokes =
                ink_overlay.Ink.HitTest(r, 60);

            // Si se encuentra algo, se borran los strokes afectados
            if (borrarStrokes.Count > 0)
            {
                // El stroke del scratchout no se maneja mas
                e.Cancel = true;

                // Se borran los strokes afectados
                ink_overlay.Ink.DeleteStrokes(borrarStrokes);

                // Se borra el stroke del scratchout
                ink_overlay.Ink.DeleteStrokes(e.Strokes);

                Refresh();
            }
        }
Beispiel #6
0
        void inkOverlay_Gesture(object sender, InkCollectorGestureEventArgs e)
        {
            // Si se esta seguro del gesture a un nivel de confianza fuerte (Strong) o intermedio (intermediate)
            // borramos. En caso contrario, no se hace nada.
            if ((e.Gestures[0].Confidence == RecognitionConfidence.Strong) ||
                (e.Gestures[0].Confidence == RecognitionConfidence.Intermediate))
            {
                switch (e.Gestures[0].Id)
                {
                case ApplicationGesture.Scratchout:
                    //Borramos

                    // Se obtiene el BoundingBox del Scratchout
                    Rectangle r = e.Strokes.GetBoundingBox();

                    // Se recorre la coleccion de strokes
                    foreach (Stroke s in ink_overlay.Ink.Strokes)
                    {
                        // Se mira si cada stroke esta incluido en el BoundingBox de Scratchou
                        // y si es asi se borra
                        DeleteInsideRectangle(s, r, e);
                    }

                    break;

                default:
                    // No se hace nada
                    break;
                }
            }

            // Se asegura de que el stroke se ha borrado
            e.Cancel = false;
            pnlInput.Invalidate();

            throw new NotImplementedException();
        }
Beispiel #7
0
            /// <summary>
            /// Handles gesture animation.
            /// </summary>
            /// <param name="e"></param>
#if MF_FRAMEWORK_VERSION_V3_0
            void PuzzleBoard_GestureHandler(object sender, InkCollectorGestureEventArgs e)
            {
                int x = e.Gesture.HotPoint.X;
                int y = e.Gesture.HotPoint.Y;
Beispiel #8
0
        void overlay_Gesture(object sender, InkCollectorGestureEventArgs e)
        {
            if (ToDoItem != null && e.Gestures.Length > 0)
            {
                overlay.Ink.DeleteStrokes();

                switch (e.Gestures[0].Id)
                {
                    case ApplicationGesture.ArrowUp:
                    case ApplicationGesture.Up:
                        ToDoItem.Position -= 1;
                        break;
                    case ApplicationGesture.ArrowDown:
                    case ApplicationGesture.Down:
                        ToDoItem.Position += 1;
                        break;
                    case ApplicationGesture.Check:
                    case ApplicationGesture.Right:
                        ToDoItem.IsCompleted = true;
                        break;
                    case ApplicationGesture.Square:
                        ToDoItem.IsCompleted = false;
                        break;
                    case ApplicationGesture.Circle:
                        ToDoItem.IsCompleted = !ToDoItem.IsCompleted;
                        break;
                }
            }
            else
            {
                e.Cancel = true;
            }
        }
Beispiel #9
0
            /// <summary>
            /// Handles gesture animation.
            /// </summary>
            /// <param name="e"></param>
#if MF_FRAMEWORK_VERSION_V3_0
            void PuzzleBoard_GestureHandler(object sender, InkCollectorGestureEventArgs e)
            {
                int x = e.Gesture.HotPoint.X;
                int y = e.Gesture.HotPoint.Y;