WPF视频播放
来源:互联网 发布:淘宝怎样退出7天退换货 编辑:程序博客网 时间:2024/05/16 14:13
MainWindow.xaml
<Window x:Class="WPF视频播放.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="简易视频播放器" Height="411.686" Width="626.916" Activated="Window_Activated_1" Deactivated="Window_Deactivated_1" Closing="Window_Closing_1"> <Grid> <MediaElement x:Name="mediaElement1" Margin="0,0,0,0" LoadedBehavior="Manual" Source="【WE教室从零教学】卷毛解说 逆转战局锤石辅助第一视角 超清.mp4" Stretch="Fill"/> </Grid></Window>
MainWindow.xaml.cs
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;namespace WPF视频播放{ /// <summary> /// MainWindow.xaml 的交互逻辑 /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Window_Activated_1(object sender, EventArgs e) { this.mediaElement1.Play(); } private void Window_Deactivated_1(object sender, EventArgs e) { this.mediaElement1.Pause(); } private void Window_Closing_1(object sender, System.ComponentModel.CancelEventArgs e) { MessageBoxResult result = MessageBox.Show("您确定要退出媒体播放器吗?\n单击“确定”退出,单击“取消”从头播放。", this.Title, MessageBoxButton.OKCancel, MessageBoxImage.Question); if (result == MessageBoxResult.Cancel) { e.Cancel = true; this.mediaElement1.Stop(); this.mediaElement1.Play(); } } }}
- WPF视频播放
- WPF窗体中视频播放
- WPF视频循环播放,通过Position设置
- WPF 窗口属性AllowsTransparency 播放视频时 卡顿问题
- 利用WPF MediaElement去播放视频或者音乐
- 用WPF控件MediaElement创建简易播放器(视频区域、播放控制区域、播放列表、循环播放)
- 用WPF控件MediaElement创建简易播放器(视频区域、播放控制区域、播放列表、循环播放)
- WPF技术触屏上的应用系列(三): 视频播放器的使用及视频播放、播放、暂停、可拖动播放进度效果实现
- 视频播放
- 视频播放
- 播放视频
- 视频播放
- 播放视频
- 播放视频
- 播放视频
- 播放视频
- 播放视频
- 视频播放
- 开发者必备的6款源码搜索引擎
- hdu 4647
- Configuring and Using the Twisted Web Server
- PHP中获取目录及子目录下的所有文件路径和目录路径
- What is Linux Driver Model ?
- WPF视频播放
- MFC程序消息处理的顺序
- MFC中OnDraw与OnPaint的区别
- hdu4606 Occupy Cities简单计算几何+floyd+最小路径覆盖+二分答案
- C语言数字类型长度
- python中的深拷贝和浅拷贝理解
- 怎么在外部类的静态方法中创建成员内部类的对象?
- uva 10055 Hashmat the brave warr…
- 488 - Triangle Wave