コード例 #1
0
 /// <summary>
 /// 回调函数,用于获取图像信息和显示图像
 /// </summary>
 /// <param name="obj">用户自定义传入参数</param>
 /// <param name="objIFrameData">图像信息对象</param>
 private void CaptureCallbackPro(object objUserParam, IFrameData objIFrameData)
 {
     try
     {
         Daheng  cam   = objUserParam as Daheng;
         HObject image = cam.dahengImage.Show(objIFrameData);
         OnImageAcqed(image);//触发事件
         image.Dispose();
         GC.Collect();
     }
     catch (Exception) { }
 }
コード例 #2
0
        /// <summary>
        /// 枚举设备
        /// </summary>
        public bool EnumDevice()
        {
            //初始化
            objIGXFactory = IGXFactory.GetInstance();
            objIGXFactory.Init();

            listIGXDeviceInfo.Clear();
            objIGXFactory.UpdateDeviceList(200, listIGXDeviceInfo);
            if (listIGXDeviceInfo.Count == 0)
            {
                return(false);
            }
            else
            {
                for (int i = 0; i < listIGXDeviceInfo.Count; i++)
                {
                    Daheng objCamera = new Daheng();
                    objCamera.strName = listIGXDeviceInfo[i].GetSN();
                    listCamera.Add(objCamera);//添加相机列队
                }
                return(true);
            }
        }