private void button_Start_Click(object sender, RoutedEventArgs e) { //设置采集连续模式 m_pOperator.SetEnumValue("AcquisitionMode", 2); // 工作在连续模式 m_pOperator.SetEnumValue("TriggerMode", 0); // 连续模式 CarmeraStartGrab(); }
//打开设备 private void button_OpenCarmer_Click(object sender, RoutedEventArgs e) { if (m_pDeviceList.nDeviceNum == 0 || m_CameraDeviceList.SelectedIndex == -1) { MessageBox.Show("无设备,请选择"); return; } //获取选择的设备信息 MyCamera.MV_CC_DEVICE_INFO device = (MyCamera.MV_CC_DEVICE_INFO)Marshal.PtrToStructure(m_pDeviceList.pDeviceInfo[m_CameraDeviceList.SelectedIndex], typeof(MyCamera.MV_CC_DEVICE_INFO)); int nRet = m_pOperator.Open(ref device); //打开设备 if (MyCamera.MV_OK != nRet) { MessageBox.Show("设备打开失败!"); return; } //设置采集连续模式 m_pOperator.SetEnumValue("AcquisitionMode", 2); // 工作在连续模式 m_pOperator.SetEnumValue("TriggerMode", 0); // 连续模式 CarmeraStartGrab(); SetCtrlWhenOpen(); }
public override void ContinuousShot() { if (m_pOperator == null || IsLink == false) { return; } try { Command = Command.Video; m_pOperator.SetEnumValue("TriggerMode", 0); IsContinuousShot = true; } catch (Exception ex) { Util.WriteLog(this.GetType(), ex); Util.Notify("相机连续采集开始异常"); } }
public void OpenCameraDevice() { if (m_CameraList.nDeviceNum == 0 || m_CameraListComboBox.SelectedIndex == -1) { MessageBox.Show("无设备,请选择"); return; } int nRet = -1; //获取选择的设备信息 MyCamera.MV_CC_DEVICE_INFO device = (MyCamera.MV_CC_DEVICE_INFO)Marshal.PtrToStructure(m_CameraList.pDeviceInfo[m_CameraListComboBox.SelectedIndex], typeof(MyCamera.MV_CC_DEVICE_INFO)); nRet = m_CameraOperator.Open(ref device); if (MyCamera.MV_OK != nRet) { MessageBox.Show("设备打开失败!"); return; } m_CameraOperator.SetEnumValue("AcquisitionMode", 2); // 工作在连续模式 m_CameraOperator.SetEnumValue("TriggerMode", 0); // 连续模式 CameraStartGrab(m_CameraPictureBox); }