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();
}
}