AForge.Robotics.Surveyor.SRV1.GetCamera C# (CSharp) Method

GetCamera() public method

Get camera object for the SRV-1 Blackfin robot/camera.

The method provides an instance of SRV1Camera, which can be used for receiving continuous video frames from the SRV-1 Blackfin camera. In the case if only one image is required, the GetImage method can be used.

Sample usage:

// get SRV-1 camera SRV1Camera camera = srv.GetCamera( ); // set NewFrame event handler camera.NewFrame += new NewFrameEventHandler( video_NewFrame ); // start the video source camera.Start( ); // ... private void video_NewFrame( object sender, NewFrameEventArgs eventArgs ) { // get new frame Bitmap bitmap = eventArgs.Frame; // process the frame }
Not connected to SRV-1. Connect to SRV-1 robot/camera /// before using this method.
public GetCamera ( ) : SRV1Camera
return SRV1Camera
        public SRV1Camera GetCamera( )
        {
            lock ( sync )
            {
                if ( socket == null )
                {
                    // handle error
                    throw new NotConnectedException( "Not connected to SRV-1." );
                }

                if ( camera == null )
                {
                    camera = new SRV1Camera( this );
                }
                return camera;
            }
        }