放大到图像中的Windows Store应用程序 [英] Zooming into image in Windows Store apps

查看:148
本文介绍了放大到图像中的Windows Store应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ScrollViewer中,在它的图像控制。它显示一个相当大的图像。我希望我的用户能够放大到用手势形象。所以我启用的的ScrollViewer的ZoomMode。然而,ScrollViewer中自动滚动回当用户释放其手指,使进出图像无法有效放大图像的左边的边缘。

I have a ScrollViewer with an Image Control in it. It displays a rather large image. I want my user to be able to zoom into the image using gestures. I therefore enabled the ZoomMode on the Scrollviewer. However the Scrollviewer automatically scrolls back to the left "edge" of the image whenever the user releases its finger, making effectively zooming in and out of the image impossible.

这是我现在用的模板:

<DataTemplate x:Key="SingleItemTemplate">
    <ScrollViewer ZoomMode="Enabled">
        <Grid Margin="5,0,5,0">
            <Image Source="{Binding ImageUrlHighRes}">
            </Image>
        </Grid>
    </ScrollViewer>
</DataTemplate>



我怎样才能解决这个问题?

How can i solve this problem?

推荐答案

您需要启用水平滚动以及(默认为关闭)

You need to enable the horizontal scrolling as well (turned off by default)

HorizontalScrollBarVisibility = "Auto"

这篇关于放大到图像中的Windows Store应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆