Handling the pinch touch event
Another interesting touch event is pinch, also referred to as zoom. While using it, the content could become smaller or bigger. In this recipe, you will learn how to handle this event in the case of an image presented on the page.
Getting ready
To step through this recipe, you need only the automatically generated project.
How to do it...
To prepare the example that handles the pinch touch event to scale the image presented on the page, perform the following steps:
Add the
Photo.jpg
file to theAssets
directory.Add an image to the page, support the necessary manipulation modes, and define a scaling transform. Do this by modifying the content of the
MainPage.xaml
file, as follows:<Page (...)> <Grid> <Image Source="/Assets/Photo.jpg" ImageOpened="Image_ImageOpened" ManipulationMode="Scale,ScaleInertia" ManipulationDelta="Image_ManipulationDelta...