2014-12-06 143 views
0

嗨我想擴大MediaElement觀看更大的視頻,但問題是我不能以任何方式做,我在設計器中手動執行,並且不起作用,那麼我嘗試手動與最小高度和最小寬度屬性,但視頻保持相同的大小。使用WPF MediaElement放大視頻

「展開」我的意思是我想要視頻填寫MediaElement。現在它非常小。

來源:

<Window x:Class="WpfApplication1.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     Title="MainWindow" Height="1028" Width="525"> 
    <Grid> 
     <MediaElement Height="512" HorizontalAlignment="Left" Margin="12,12,0,0" Name="player" VerticalAlignment="Top" Width="479" MinHeight="800" /> 
     <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="157,566,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" /> 
    </Grid> 
</Window> 
+0

展開MediaElement以查看錶格 – adsdsa 2014-12-06 00:43:41

+0

上的更多長視頻感謝-1,發佈更新。 – adsdsa 2014-12-06 00:46:53

+0

我說寬度,沒有長度 – adsdsa 2014-12-06 00:50:04

回答

1

爲了讓您的內容填滿MediaElement區域,設置Stretch屬性設置爲「填充」:

<MediaElement Stretch="Fill" .../> 

更多的信息和這個其他有效數值見MSDN屬性。

+0

感謝您的耐心和支持 – adsdsa 2014-12-06 01:16:54

相關問題