以下是窗口 AfterLoad 事件:
Dim sb As WinForm.ComboBox = e.Form.Controls("设备")
Dim ylk As WinForm.Panel = e.Form.Controls("预览框")
'获取摄像头列表
Functions.Execute("获取设备列表")
'显示摄像头列表
Dim i As Integer
sb.Items.Clear
For i=0 To _CamList.Count - 1
sb.Items.Add(_CamList(i))
Next
'默认选中第一个摄像头
If _CamList.Count > 1 And _CamIndex < 1
_CamIndex = 1
End If
sb.SelectedIndex = _CamIndex
'激活预览
If _CamList.Count > 0
Functions.Execute("预览视频",_CamIndex,ylk)
Else
MessageBox.Show("未检测摄像头,请先连接摄像头!","警告")
e.Form.Close()
End If
'截图框初始位置
Dim x As Integer = ylk.Left
Dim y As Integer = ylk.Top
Dim w As Integer = ylk.Width
Dim h As Integer = ylk.Height
Functions.Execute("移动截图框",ylk,x,y,w,h)
提示:未声明名称:“_CamList”
错误代码:上面红色代码