询问者
(WP8.1)使用FlipView控件,中加入Image,如何实现旋转后显示的图片再放大

问题
-
使用FlipView控件,中加入Image,如何实现显示的图片旋转后再拉伸到合适屏幕大小?
本来在FlipView中水平显示图片(有多个图片),
在点击旋转后,让图片纵向显示,并拉伸成屏幕大小;
这样如何实现?其中旋转能实现 ,就是旋转之后如何拉伸?
部分代码如下:
前台代码:
<Grid x:Name="ContentRoot" Margin="0,0,0,0"> <FlipView x:Name="fv" > <FlipView.ItemTemplate> <DataTemplate> <Image x:Name="img" Source="{Binding ImageSource}" Stretch="Uniform"></Image> </DataTemplate> </FlipView.ItemTemplate> </FlipView> </Grid>
后台代码如下:private void Button_Click(object sender, RoutedEventArgs e) { RotateTransform rotate = new RotateTransform(); rotate.CenterX = ContentRoot.RenderSize.Width/2; rotate.CenterY = ContentRoot.RenderSize.Height / 2; rotate.Angle = 90; this.fv.RenderTransform = rotate;
}
全部回复
-
Hello,
你可以尝试用visualtreehelper 来获取定义的image control,然后设置它的高和宽。
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.
-
-
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.