在C#中将AVI视频插入VideoSourcePlayer [英] Inserting AVI Video into VideoSourcePlayer in C#
本文介绍了在C#中将AVI视频插入VideoSourcePlayer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
any1可以为我提供代码2gwif,以便在我打开文件时插入AVI Video并能够播放它而无需说"Video Was Stopped"的提示.谢谢:-D
Can any1 provide me with code 2gther wif explaination for inserting AVI Video and being able to play it without it saying "Video Was Stopped" the moment i open the file.Thank You :-D
推荐答案
private bool CheckValidity(string strName)
{
//show error if user specified invalid file
if (strName.EndsWith(".avi") == false)
{
MessageBox.Show("File name must end with .avi", "Invaild File Type", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Fill in the empty box");
return false;//to indicate invalid file type
}
//change status of Buttons if file name is valid
else
{
btnOpenFile.Enabled = false;
btnEnter.Enabled = true;
return true;//to indicate text file specified
}
}//end method CheckValidity
private void btnLoadImage_Click(object sender, EventArgs e)
{
if (objOpenFileDialog.ShowDialog() == DialogResult.OK)
{
// create video source
AVIFileVideoSource fileSource = new AVIFileVideoSource(objOpenFileDialog.FileName);
OpenVideoSource(fileSource);
}
}
这篇关于在C#中将AVI视频插入VideoSourcePlayer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文