public void OpenDevice1(IntPtr pictureHand) { string ip = IniFiles.iniFile.IniReadValue("device1", "ip"); string com = IniFiles.iniFile.IniReadValue("device1", "com"); string user = IniFiles.iniFile.IniReadValue("device1", "user"); string password = IniFiles.iniFile.IniReadValue("device1", "password"); Log.myLog.Info("ip=" + ip); Log.myLog.Info("com=" + com); Log.myLog.Info("user="******"password="******"打开设备失败!"); return; } //输出到pictureBox_in_video VzClientSDK.VzLPRClient_SetPlateInfoCallBack(handle, null, IntPtr.Zero, 0); int m_nPlayHandle2 = VzClientSDK.VzLPRClient_StartRealPlay(handle, pictureHand); // 设置车牌识别结果回调 m_PlateResultCB1 = new VzClientSDK.VZLPRC_PLATE_INFO_CALLBACK(OnPlateResult1); VzClientSDK.VzLPRClient_SetPlateInfoCallBack(handle, m_PlateResultCB1, IntPtr.Zero, 1); }
//输出功能 private void btnOutput_Click(object sender, EventArgs e) { int lprHandle = GetSeleHandle(); if (lprHandle == 0) { MessageBox.Show("请选择一台列表中的设备", "提示"); return; } if (lprHandle == GetPicBox1Handle() || lprHandle == GetPicBox2Handle()) { MessageBox.Show("该设备已经输出在视频窗口中", "提示"); return; } //在第一个视频窗口播放视频 if (m_bFirst) { pictureBox1.Image = null;//不显示图片 if (m_nPlayHandle > 0) { VzClientSDK.VzLPRClient_StopRealPlay(m_nPlayHandle);//停止当前播放的视频 m_nPlayHandle = 0; } int picHandle1 = GetPicBox1Handle(); if (picHandle1 > 0) { VzClientSDK.VzLPRClient_SetPlateInfoCallBack(picHandle1, null, IntPtr.Zero, 0);//清空上一个车牌识别结果 } m_nPlayHandle = VzClientSDK.VzLPRClient_StartRealPlay(lprHandle, pictureBox1.Handle);//播放实时视频 pictureBox1.Tag = lprHandle; //设置车牌识别结果回调 m_PlateResultCB = new VzClientSDK.VZLPRC_PLATE_INFO_CALLBACK(OnPlateResult); VzClientSDK.VzLPRClient_SetPlateInfoCallBack(lprHandle, m_PlateResultCB, IntPtr.Zero, 1); } //在第二个视频窗口播放视频 else { pictureBox2.Image = null;//不显示图片 if (m_nPlayHandle2 > 0) { VzClientSDK.VzLPRClient_StopRealPlay(m_nPlayHandle2);//停止当前播放的视频 m_nPlayHandle2 = 0; } int picHandle2 = GetPicBox2Handle(); if (picHandle2 > 0) { VzClientSDK.VzLPRClient_SetPlateInfoCallBack(picHandle2, null, IntPtr.Zero, 0);//清空上一个车牌识别结果 } m_nPlayHandle2 = VzClientSDK.VzLPRClient_StartRealPlay(lprHandle, pictureBox2.Handle);//播放实时视频 pictureBox2.Tag = lprHandle; //设置车牌识别结果回调 m_PlateResultCB2 = new VzClientSDK.VZLPRC_PLATE_INFO_CALLBACK(OnPlateResult); VzClientSDK.VzLPRClient_SetPlateInfoCallBack(lprHandle, m_PlateResultCB2, IntPtr.Zero, 1); } }