AForge.net调用多个摄像头问题
求各位大侠帮帮忙,我三个都不能同时调用,能帮我看看吗?三个摄像头都没有问题,切换调用都可以显示!三个只能显示其中的两个!
代码:
// 创建第一个摄像头数据源
private void StartCameras()
{
// 创建第一个摄像头数据源
if (comboBox1.Enabled == true)
{
VideoCaptureDevice videoSource1 = new VideoCaptureDevice(videoDevices[this.comboBox1.SelectedIndex].MonikerString);
videoSource1.DesiredFrameRate = 10;
videoSourcePlayer1.VideoSource = videoSource1;
videoSourcePlayer1.Start();
}
// 创建第二个摄像头数据源
if (comboBox2.Enabled == true)
{
//System.Threading.Thread.Sleep(500);
VideoCaptureDevice videoSource2 = new VideoCaptureDevice(videoDevices[this.comboBox2.SelectedIndex].MonikerString);
videoSource2.DesiredFrameRate = 10;
videoSourcePlayer2.VideoSource = videoSource2;
videoSourcePlayer2.Start();
}
//创建第三个摄像头数据源
if (comboBox3.Enabled == true)
{
VideoCaptureDevice videoSource3 = new VideoCaptureDevice(videoDevices[this.comboBox3.SelectedIndex].MonikerString);
videoSource3.DesiredFrameRate = 10;
videoSourcePlayer3.VideoSource = videoSource3;
videoSourcePlayer3.Start();
}
}
代码:
// 创建第一个摄像头数据源
private void StartCameras()
{
// 创建第一个摄像头数据源
if (comboBox1.Enabled == true)
{
VideoCaptureDevice videoSource1 = new VideoCaptureDevice(videoDevices[this.comboBox1.SelectedIndex].MonikerString);
videoSource1.DesiredFrameRate = 10;
videoSourcePlayer1.VideoSource = videoSource1;
videoSourcePlayer1.Start();
}
// 创建第二个摄像头数据源
if (comboBox2.Enabled == true)
{
//System.Threading.Thread.Sleep(500);
VideoCaptureDevice videoSource2 = new VideoCaptureDevice(videoDevices[this.comboBox2.SelectedIndex].MonikerString);
videoSource2.DesiredFrameRate = 10;
videoSourcePlayer2.VideoSource = videoSource2;
videoSourcePlayer2.Start();
}
//创建第三个摄像头数据源
if (comboBox3.Enabled == true)
{
VideoCaptureDevice videoSource3 = new VideoCaptureDevice(videoDevices[this.comboBox3.SelectedIndex].MonikerString);
videoSource3.DesiredFrameRate = 10;
videoSourcePlayer3.VideoSource = videoSource3;
videoSourcePlayer3.Start();
}
}
...全文
相关推荐
vb.net调用摄像头扫描二维码
天下代码一大抄,找来找去都不能实现这功能,最后自己依葫芦画瓢写了一个,仅供参考
AForge.NET 入门
一、Aforge.NET简介 AForge.NET是一个专门为开发者和研究者基于C#框架设计的,这个框架提供了不同的类库和关于类库的资源,还有很多应用程序例子,包括计算机视觉与人工智能,图像处理,神经网络,遗传算法,机器学习,机器人等领域。 这个框架由一系列的类库组成。主要包括有: AForge.Imaging —— 一些日常的图像处理和
C#-调用usb摄像头
C#调用usb摄像头
C#读取USB摄像头
该程序使用C#语言编写,主要功能为调取笔记本自带摄像头以及USB摄像头,并显示在窗体中,包含有截图录像功能。
C# WPF使用AForge类库操作USB摄像头拍照并保存.zip
C# WPF使用AForge类库操作USB摄像头拍照并保存.zip


