Start() публичный Метод

Start video source.
Starts video source and returns execution to caller. Video camera will be started and will provide new video frames through the NewFrame event.
There is no XIMEA camera with specified ID connected to the system. An error occurred while communicating with a camera. See error /// message for additional information.
public Start ( ) : void
Результат void
Пример #1
0
        // On "Connect" button click
        private void connectButton_Click( object sender, EventArgs e )
        {
            // set busy cursor
            this.Cursor = Cursors.WaitCursor;

            // close whatever is open now
            CloseCamera( );

            if ( videoSource == null )
            {
                try
                {
                    videoSource = new XimeaVideoSource( deviceCombo.SelectedIndex );
                    
                    // start the camera
                    videoSource.Start( );

                    // get some parameters
                    nameBox.Text = videoSource.GetParamString( CameraParameter.DeviceName );
                    snBox.Text   = videoSource.GetParamString( CameraParameter.DeviceSerialNumber );
                    typeBox.Text = videoSource.GetParamString( CameraParameter.DeviceType);

                    // width
                    widthUpDown.Minimum = videoSource.GetParamInt( CameraParameter.WidthMin );
                    widthUpDown.Maximum = videoSource.GetParamInt( CameraParameter.WidthMax );
                    widthUpDown.Value = videoSource.GetParamInt( CameraParameter.WidthMax );

                    // height
                    heightUpDown.Minimum = videoSource.GetParamInt( CameraParameter.HeightMin );
                    heightUpDown.Maximum = videoSource.GetParamInt( CameraParameter.HeightMax );
                    heightUpDown.Value = videoSource.GetParamInt( CameraParameter.HeightMax );

                    // exposure
                    exposureUpDown.Minimum = videoSource.GetParamInt( CameraParameter.ExposureMin ) / 1000;
                    exposureUpDown.Maximum = videoSource.GetParamInt( CameraParameter.ExposureMax ) / 1000;
                    exposureUpDown.Value = 0;
                    exposureUpDown.Value = 10;

                    // gain
                    gainUpDown.Minimum = new Decimal( videoSource.GetParamFloat( CameraParameter.GainMin ) );
                    gainUpDown.Maximum = new Decimal( videoSource.GetParamFloat( CameraParameter.GainMax ) );
                    gainUpDown.Value = new Decimal( videoSource.GetParamFloat( CameraParameter.Gain ) );
                    
                    videoSourcePlayer.VideoSource = videoSource;

                    EnableConnectionControls( false );

                    // reset stop watch
                    stopWatch = null;

                    // start timer
                    timer.Start( );
                }
                catch ( Exception ex )
                {
                    MessageBox.Show( "Failed openning XIMEA camera:\n\n" + ex.Message, "Error",
                        MessageBoxButtons.OK, MessageBoxIcon.Error );
                    CloseCamera( );
                }
            }

            this.Cursor = Cursors.Default;
        }