locked
Pinch and Zoom on Rectangle RRS feed

  • Question

  • Is there an event to recognize a Pinch or Zoom gesture on a Rectangle?

    What mouse event should I use if it is not a touch device?

    Tuesday, February 5, 2013 3:15 PM

Answers

  • 1.- Pinch and Zoom: Input: XAML user input events sample : Scenario 4: use pinch and zoom in the simulator

    2.- Mouse equivalent: adapt the code for Scenario 4 as follows to detect Mouse wheel change:

           public Scenario4()
            {
                // ...
                ManipulateMe.PointerWheelChanged += ManipulateMe_PointerWheelChanged;
            }
    
            void ManipulateMe_PointerWheelChanged(object sender, PointerRoutedEventArgs e)
            {
                Windows.UI.Input.PointerPoint center = e.GetCurrentPoint(ManipulateMe);
                int mouseWheelDelta = center.Properties.MouseWheelDelta;
                // use 'mouseWheelDelta' value to set ScaleX and ScaleY like in 'ManipulateMe_ManipulationDelta' method
            }
    

    • Marked as answer by prog_1 Wednesday, February 6, 2013 9:48 AM
    Tuesday, February 5, 2013 4:56 PM