try
Dim cmr As New DCap.Filters()
catch ex As exception
msgbox("没有设备")
'Return
e.Form.close
'Return
End try
Dim camList As WinForm.ComboBox = e.Form.Controls("CamList")
'设置控件大小
Functions.Execute("SetCamBoxSize",e.Form,True)
'设置移动条
e.Form.Controls("BarX").Value = e.Form.Controls("LineBox").Left - e.Form.Controls("CamViewBox").Left
e.Form.Controls("BarY").Value = e.Form.Controls("CamViewBox").Height - (e.Form.Controls("LineBox").Top - e.Form.Controls("CamViewBox").Top)
e.Form.Controls("BarW").Value = e.Form.Controls("LineBox").Width
e.Form.Controls("BarH").Value = e.Form.Controls("CamViewBox").Height - e.Form.Controls("LineBox").Height
'显示拍照框尺寸
e.Form.Controls("BoxW").Value = e.Form.Controls("LineBox").Width
e.Form.Controls("BoxH").Value = e.Form.Controls("LineBox").Height
_lVars(0) = e.Form.Controls("AutoTake").Checked
'设置保存路径
If _sVars(0) <> ""
e.Form.Controls("FileName").Value = _sVars(0)
End If
'获取摄像头列表
Functions.Execute("GetCams")
'显示摄像头列表
Dim i As Integer
camList.Items.Clear
For i=0 To _CamList.Count - 1
camList.Items.Add(_CamList(i))
Next
'默认选中第一个摄像头
If _CamList.Count > 1 And _CamIndex < 1
_CamIndex = 1
End If
camList.SelectedIndex = _CamIndex
'激活预览
If _CamList.Count > 0
Functions.Execute("SetCamView",_CamIndex,e.Form.Controls("CamView"))
Else
MessageBox.Show("未检测摄像头,请先连接摄像头!","警告")
e.Form.Close()
End If
'启动定时器
_iVars(0) = 0
e.Form.TimerEnabled = True
Forms("查看证明材料").Controls("PictureViewer1").open()