本文整理汇总了C#中Video.Open方法的典型用法代码示例。如果您正苦于以下问题:C# Video.Open方法的具体用法?C# Video.Open怎么用?C# Video.Open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video.Open方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button3_Click
private void button3_Click(object sender, EventArgs e)
{
//VideoState = (int)VideoStateEnum.Open;
openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "Видео файл (*.avi)|*.avi|Видео файл (*.wmv)|*.wmv|Видео файл (*.mp4)|*.mp4|Все файлы (*.*)|*.*";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
FileInfo fi = new FileInfo(openFileDialog1.FileName);
if (fi.Length > 0)
{
if (video != null &&
(VideoState == (int) VideoStateEnum.Stop || VideoState == (int) VideoStateEnum.Play))
{
video.Stop();
}
if (video == null) backgroundWorker1.RunWorkerAsync();
video = new Video(openFileDialog1.FileName);
video.Open(openFileDialog1.FileName);
video.Owner = panel1;
VideoState = (int) VideoStateEnum.Stop;
label1.Text = video.Duration.ToString();
label2.Text = video.StopPosition.ToString();
trackBar1.Maximum = (int) video.Duration;
trackBar1.TickFrequency = (int) video.Duration/100;
VolumeTrackBar.Minimum = -5000;
VolumeTrackBar.Maximum = 0;
VolumeTrackBar.TickFrequency = VolumeTrackBar.Minimum/10;
video.Audio.Volume = VolumeTrackBar.Minimum/2;
VolumeTrackBar.Value = video.Audio.Volume;
video.StopWhenReady();
}
}
else
{
VideoState = (int) VideoStateEnum.None;
}
}