public static HikvisionPreviewFun GetInstance()
 {
     if (instance == null)
     {
         instance = new HikvisionPreviewFun();
     }
     return(instance);
 }
Beispiel #2
0
 /// <summary>
 /// 摄像头预览方法
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void kButtonView_Click(object sender, EventArgs e)
 {
     if (StaticData.g_CameraSelectChannel > 0)
     {
         Hikvision previewFun = HikvisionPreviewFun.GetInstance();
         //根据选中的摄像头通道号跟IP地址进行预览
         string    srtSql = "IP地址= '" + StaticData.g_CameraSelectNVRIP + "'";
         DataRow[] dr     = StaticData.g_dtNVR.Select(srtSql);
         if (dr.Length > 0)
         {
             previewFun.PreviewFun(Convert.ToInt32(dr[0]["userid"]), StaticData.g_CameraSelectChannel);
         }
     }
     else
     {
         MessageBox.Show("请点击摄像头名称选择要预览的摄像头画面");
     }
 }