我MediaElement
在PopUp
. 当我将 MediaElement 调整为宽屏时,它会在底部切割一个区域(见图)。
我做错了什么?如何解决?非常感谢你!
XAML:
<Popup PlacementRectangle="-500,0,0,0" Placement="Relative" IsOpen="True" Name="popup">
<MediaElement Name="me" Width="480" Height="360" Volume="1"
MouseLeftButtonUp="me_MouseLeftButtonUp"/>
</Popup>
代码:
bool fullscreen = false;
private void me_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
fullscreen = !fullscreen;
if (fullscreen)
{
popup.PlacementRectangle = new Rect(0, 0, 0, 0);
popup.Placement = PlacementMode.Absolute;
me.Width = Screen.PrimaryScreen.Bounds.Width;
me.Height = Screen.PrimaryScreen.Bounds.Height;
}
else
{
popup.PlacementRectangle = new Rect(-500, 0, 0, 0);
popup.Placement = PlacementMode.Relative;
me.Width = 480;
me.Height = 360;
}
}