Exemple #1
0
        public override bool DoRegisterImageGrabbedCallBack()
        {
            bool rt = false;

            MVSDK.CameraSdkStatus status = MVSDK.CameraSdkStatus.CAMERA_STATUS_FAILED;
            try
            {
                MVSDK.pfnCameraGrabberFrameCallback del = _SDKImageGrabbedDel;

                if (del != null && _deviceRef > 0)
                {
                    status = MVSDK.MvApi.CameraGrabber_SetRGBCallback(_grabber, del, IntPtr.Zero);
                    rt     = (MVSDK.CameraSdkStatus.CAMERA_STATUS_SUCCESS == status) ? true : false;
                    if (!rt)
                    {
                        if (DriverExceptionDel != null)
                        {
                            DriverExceptionDel(string.Format("错误:迈德威视相机注册图像采集回调失败!\n错误代码:{0:X8}", System.Convert.ToInt32(status)));
                        }
                    }
                }
                else
                {
                    if (DriverExceptionDel != null)
                    {
                        DriverExceptionDel(string.Format("错误:迈德威视相机注册采集回调函数失败!\n错误描述:{0}", "设备未连接"));
                    }
                }
            }
            catch
            {
            }
            finally
            {
            }

            return(rt);
        }
Exemple #2
0
 private CameraDriver_MindVision()
 {
     _grabber            = IntPtr.Zero;
     _deviceRef          = 0;
     _SDKImageGrabbedDel = new pfnCameraGrabberFrameCallback(OnSDKImageGrabbed);
 }
Exemple #3
0
 public CameraDriver_MindVision(ProCommon.Communal.CameraProperty cam) : base(cam)
 {
     _grabber            = IntPtr.Zero;
     _deviceRef          = 0;
     _SDKImageGrabbedDel = new pfnCameraGrabberFrameCallback(OnSDKImageGrabbed);
 }