Reputation: 2203
I have a WinRT Metro application where i show an image. I now like to zoom in/out with a pinch gesture. Is there an easy way to activate this on the image control, or do i have to implement the whole gesture/pinch logic myself?
Upvotes: 0
Views: 2557
Reputation: 2203
I found a better solution.
Just use a ScrollViewer control, this will to the whole zoom for you:
<ScrollViewer x:Name="ImageScrollViewer" HorizontalAlignment="Stretch" HorizontalScrollBarVisibility="Visible" VerticalAlignment="Stretch" MinZoomFactor="0.5" >
<Grid>
<Image x:Name="SmugImage" Source="http://www.website.com/image.png" Stretch="Uniform" Grid.Column="0" Grid.Row="0" />
</Grid>
</ScrollViewer>
Make sure to set HorizontalScrollBarVisibility to Visible, otherwise the image will be left aligned when you start zooming.
Upvotes: 6
Reputation: 521
According to a Windows Metro Forum here there isn't a built in handler for what u want to do, but they do link off to sample code for what i believe you are trying to achieve on this site
Upvotes: 2