【发布时间】:2013-11-28 16:08:50
【问题描述】:
我有一个页面,MediaElement 在上面拉伸:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<MediaElement x:Name="Player" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch" Source="myvideo.mp4"/>
</Grid>
当我打开页面时,它看起来像这样:
那是因为视频与页面大小不同。
好的,我想拉伸我设置 ViewBox 的内容:
<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 中有一个内置的 Stretch 选项,但是当我设置它时,它说:元素 MediaElement 上的未知成员“Stretch”
【问题讨论】:
标签: c# windows-8 mediaelement windows-8.1