Пример #1
0
        public void StartVideo(bool isContinue = true)
        {
            try
            {
                if (managedCamera != null && _videoMode == false)
                {
                    if (isContinue)
                    {
                        // Set acquisition mode to continuous
                        IEnum iAcquisitionMode = nodeMap.GetNode <IEnum>("AcquisitionMode");

                        IEnumEntry iAcquisitionModeContinuous = iAcquisitionMode.GetEntryByName("Continuous");

                        iAcquisitionMode.Value = iAcquisitionModeContinuous.Symbolic;
                    }
                    // Configure image events
                    imageEventListener = new ImageEventListener(imageQueue);
                    managedCamera.RegisterEvent(imageEventListener);

                    // Begin acquiring images
                    managedCamera.BeginAcquisition();

                    _videoMode = true;
                }
            }
            catch (SpinnakerException ex)
            {
                Debug.WriteLine("Error: {0}", ex.Message);
            }
        }
Пример #2
0
        public override void StartCapture()
        {
            try
            {
                if (camera != null && _capturingImage == false)
                {
                    // Configure image events
                    camera.RegisterEvent(imageEventListener);

                    // Begin acquiring images
                    camera.BeginAcquisition();
                    _capturingImage = true;
                }
            }
            catch (SpinnakerException ex)
            {
                Debug.WriteLine("Error: {0}", ex.Message);
            }
        }
Пример #3
0
        // TODO: need to seperate connect camera and start capture
        public bool Start(ImageReceivedEventHandler OnImageReceived)
        {
            bool result = false;

            try
            {
                ImageReceivedEventNotification = OnImageReceived;

                // Configure image events
                imageEventListener = new ImageEventListener(this);
                camera.RegisterEvent(imageEventListener);

                result = true;
            }
            catch (Exception ex)
            {
                lastError = ex.Message;
                result    = false;
                Disconnect();
            }

            return(result);
        }
Пример #4
0
        public void StartVideo()
        {
            try
            {
                if (managedCamera != null && _videoMode == false)
                {
                    // Set acquisition mode to continuous
                    managedCamera.AcquisitionMode.Value = AcquisitionModeEnums.Continuous.ToString();

                    // Configure image events
                    imageEventListener = new ImageEventListener(imageQueue);
                    managedCamera.RegisterEvent(imageEventListener);

                    // Begin acquiring images
                    managedCamera.BeginAcquisition();

                    _videoMode = true;
                }
            }
            catch (SpinnakerException ex)
            {
                Debug.WriteLine("Error: {0}", ex.Message);
            }
        }