[求助]在一个窗口调取2个摄像头,怎么老是只显示1个?
此主题相关图片如下:s1.jpg
使用的代码是下面的:
'获取摄像头列表
Dim camList As WinForm.ComboBox = e.Form.Controls("CamList")
Dim camList1 As WinForm.ComboBox = e.Form.Controls("CamList1")
Functions.Execute("GetCams")
'显示摄像头列表
Dim i As Integer
camList.Items.Clear
camList1.Items.Clear
For i=0 To _CamList.Count - 1
camList.Items.Add(_CamList(i))
camList1.Items.Add(_CamList(i))
Next
'默认选中第一个摄像头
If _CamList.Count > 1 And _CamIndex < 1
_CamIndex = 1
End If
camList.SelectedIndex = _CamIndex
camList1.SelectedIndex = _CamIndex
'激活预览
If _CamList.Count > 0
_CamIndex = 1
Functions.Execute("SetCamView",_CamIndex,e.Form.Controls("CamView"))
Functions.Execute("SetCamView",_CamIndex,e.Form.Controls("CamView1"))
Else
MessageBox.Show("未检测摄像头,请先连接摄像头!","警告")
e.Form.Close()
End If