Windows phone 8.1放大webview中的元素,如浏览器

时间:2015-04-22 21:39:29

标签: windows-phone-8 webview windows-phone-8.1

如何将webview缩放到元素(图像)?就像使用浏览器双击元素一样。

1 个答案:

答案 0 :(得分:0)

There is a property called Scale in Composite Transform of any UIElement. Check below code:

<Grid Height="250" Width="250">
    <Grid.RenderTransform>
        <CompositeTransform x:Name="cmpTransform" ScaleX="1" ScaleY="1" />
    </Grid.RenderTransform>
</Grid>

This Scale Element will help you to Zoom In and Out.

If you want to Zoom on Double Tap event then handle that event with event handler having code like below:

cmpTransform.ScaleX = 5;
cmpTransform.ScaleY = 5;

First try it yourself, and if you find any issues, mention here..!

Hope that helps..!