this.Background = new System.Windows.Media.ImageBrush(new System.Windows.Media.Imaging.BitmapImage(new Uri(MY URL HERE)));
上記のコードは、画像コントロールをその画像と共に表示するのに役立ちます。動画ファイルを再生したい。
System.Windows.Media
ライブラリには、ビデオ ファイルを再生する方法はありますか?
this.Background = new System.Windows.Media.ImageBrush(new System.Windows.Media.Imaging.BitmapImage(new Uri(MY URL HERE)));
上記のコードは、画像コントロールをその画像と共に表示するのに役立ちます。動画ファイルを再生したい。
System.Windows.Media
ライブラリには、ビデオ ファイルを再生する方法はありますか?
WPF を使用している場合は、これを試すことができます。
//
// Create a VideoDrawing.
//
MediaPlayer player = new MediaPlayer();
player.Open(new Uri(@"sampleMedia\xbox.wmv", UriKind.Relative));
VideoDrawing aVideoDrawing = new VideoDrawing();
aVideoDrawing.Rect = new Rect(0, 0, 100, 100);
aVideoDrawing.Player = player;
DrawingBrush brush = new DrawingBrush(aVideoDrawing);
this.Background = brush;
// Play the video once.
player.Play();
これを見てください:Videobrush。それがうまくいくかどうか教えてください。