In the two previous recipes, you learned how to handle the pinch and rotate touch events. However, is it possible to combine them? Of course! You will learn how to scale and rotate the image at the same time in this recipe.
To prepare the example that handles both the pinch and rotate touch events to scale and rotate 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 scaling and rotation transforms. 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, ...