Example #1
0
        /// <summary>
        /// Starts the continuous image acquisition and opens the camera
        /// Registers the event handler for the new frame event
        /// </summary>
        /// <param name="frameReceivedHandler">The FrameReceivedHandler (delegate)</param>
        public void StartContinuousImageAcquisition(FrameReceivedHandler frameReceivedHandler)
        {
            bool bError = true;

            try
            {
                // Register frame callback
                if (null != frameReceivedHandler)
                {
                    this.m_Camera.OnFrameReceived += this.OnFrameReceived;
                    this.m_FrameReceivedHandler    = frameReceivedHandler;
                }

                // Reset member variables
                m_RingBitmap     = new RingBitmap(m_RingBitmapSize);
                m_ImageInUse     = true;
                this.m_Acquiring = true;

                // Start synchronous image acquisition (grab)
                this.m_Camera.StartContinuousImageAcquisition(3);

                bError = false;
            }
            finally
            {
                // Close camera already if there was an error
                if (true == bError)
                {
                    try
                    {
                        this.ReleaseCamera();
                    }
                    catch
                    {
                        // Do Nothing
                    }
                }
            }
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the VimbaHelper class.
 /// </summary>
 public VimbaHelper()
 {
     m_RingBitmap = new RingBitmap(m_RingBitmapSize);
 }