我有一个页面,并MediaElement的拉伸就可以了:处理的MediaElement视频
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<MediaElement x:Name="Player" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch" Source="myvideo.mp4"/>
</Grid>
当我打开网页,它看起来像这样:
那是因为视频不是与Page相同的尺寸。
好吧,我想延长I设置视框内容:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Viewbox Stretch="UniformToFill" StretchDirection="Both">
<MediaElement x:Name="Player" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch" Source="myvideo.mp4"/>
</Viewbox>
</Grid>
但现在的标志(视频中心)是不是在页面的中心。 如何实现它?
现在看起来是这样的:
从中心偏移只有垂直,平铺看起来像标志保留在中心。
有在MediaElement的扩展选择一个构建,但somewhy当我设置它,它说:未知的成员“拉伸”元素的MediaElement
NOP,得到的答复是更容易视框的VerticalAligment = “中心” – Cheese