0
我想开发一个简单的应用程序,我加载一个视频文件,然后逐帧显示在我的屏幕上。AForge.Video.DirectShow位图参数ArgumentException
加载视频文件,我用这个代码:
FileVideoSource fileVideo = new FileVideoSource(myVideoSource);
fileVideo.NewFrame += fileVideo_NewFrame;
fileVideo.Start();
,然后在fileVideo_NewFrame
,我捕捉到这样的每一帧:
if (SynchronizationContext.Current != uiContext)
{
uiContext.Post(delegate { fileVideo_NewFrame(sender, eventArgs);}, null);
return;
}
Bitmap bitmap = eventArgs.Frame;
PictureBoxvideo.Image = new Bitmap(bitmap);
bitmap.Dispose();
但我收到System.ArgumentException
(所以excplicit ...)。如果我在fileVideo
停止调试,我可以看到这一点:
位图似乎没有填充值。
任何想法,为什么视频不加载罚款?
感谢您的帮助!