问题描述
从昨天开始,我就致力于在 C# 中集成网络摄像头。一般来说,我没有问题。我的罗技 C270 (720p) 也输出平滑的图像。然而,今天我不幸地发现 C920 (1080p) 的实时取景非常滞后。我使用 AForge 的 NuGet 包。
附上我使用的代码:
private AForge.Video.DirectShow.VideoCaptureDevice videoSource;
videoSource = new AForge.Video.DirectShow.VideoCaptureDevice(this.videosources[this.dropdown_videosources.Selectedindex].MonikerString);
string highestSolution = "1920;1080";
videoSource.VideoResolution = videoSource.VideoCapabilities[System.Convert.ToInt32(highestSolution.Split(';')[1])];
videoSource.NewFrame += new AForge.Video.NewFrameEventHandler(videoSource_NewFrame);
videoSource.Start();
void videoSource_NewFrame(object sender,AForge.Video.NewFrameEventArgs eventArgs) {
this.picBox_webcam.BackgroundImage = (Bitmap)eventArgs.Frame.Clone();
}
我的部分代码可能会丢失,因为它分布在多个类/文件中。但是,关键部分应该在那里。 我按照以下说明操作:https://code-bude.net/2011/06/02/webcam-benutzen-in-csharp/
正如我所说,实时图像是可见的,到目前为止一切正常。但不幸的是,C920 的图像以一种无法使用的方式撒谎。
我很感激任何建议。
来自德国的问候
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)