加载视频并在PicturBox中显示 [英] Load a video and display in PicturBox
本文介绍了加载视频并在PicturBox中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我是一个初学者,我的问题是如何从硬盘加载视频并将其显示在图片框中?.我尝试使用此视频
Hi
i am a beginner my question is how to load a video from your hard drive and display it in picture box?.I have tried using this
pictureBox2.Image=System.Drawing.Image.FromFile(@"E:\test.avi");
却说内存不足
问候
but it says out of memory
Regards
推荐答案
查看此线程:
http://social.msdn.microsoft.com/论坛/en-US/csharpgeneral/thread/8d9d3dec-368a-491b-b628-c314d2751f57 [
See this thread:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/8d9d3dec-368a-491b-b628-c314d2751f57[^]
我是aforge的忠实粉丝
I am a big fan of aforge
AVIReader reader2 = new AVIReader();
System.Drawing.Bitmap[] readArray = new System.Drawing.Bitmap[10000];
//Write the code below under a button etc
reader3.Open(@"E:\myvideo.avi");//file path
int count = reader3.Length - 1;
for (int i = 0; i < reader3.Length - 1; i++)//iterate through each frame
{
readArray[i] = reader3.GetNextFrame();
pictureBox2.Image = (System.Drawing.Image)readArray[i];
pictureBox2.Refresh();
}
totalFrames = reader3.Length - 1;
reader.Close();
这篇关于加载视频并在PicturBox中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文