ICImagingControl.LivePrepare Method

This method tries to setup the image stream by connecting the device with the display and the sink and inserting frame filters and overlays.
Public void LivePrepare();
Return Value:

If the image stream could not have been prepared, an exception is thrown.


LivePrepare prepares the image stream but does not start the live video and also does not allocate bandwidth on the used bus (FireWire or USB). Therefore this method is suitable in an environment with more than one video capture device. Subsequent starts of the live video by a call to LiveStart are much faster than LiveStart without a previous LivePrepare call.

A prepared and started live stream can be stopped and switched back to prepared state by a call to LiveSuspend.

A call to LiveStop clears the prepared live stream.

No operations which may change the layout of the video stream are permitted after LivePrepare was called. These operations are:


Introduced in version 3.1


This example shows to use some IC Imaging Controls in an array and open some video capture devices. The image streams are prepared right after the video capture devices have been opened.

In a simulated processing loop MemorySnapImage is executed in sequence on each IC Imaging Control. This loop runs relatively fast, because the live streams for each video capture have already been prepared.

// Create ICImagingControl instances for each connected video capture device. int CameraCount = 2; TIS.Imaging.ICImagingControl[] IC = new ICImagingControl[CameraCount]; // Open the video capture devices and prepare the live video stream for( int Camera = 0; Camera < CameraCount; Camera++ ) { IC[Camera] = new ICImagingControl(); IC[Camera].ShowDeviceSettingsDialog(); try { // Try to prepare the image stream. IC[Camera].LivePrepare(); } catch( ICException Ex ) { MessageBox.Show(Ex.Message, "LivePrepare Error"); } } // Now do some processing, e.g. snap an image. This loop simulates // 10 times image processing for each camera in sequence. for( int i = 0; i < 10; i++ ) { for( int Camera = 0; Camera < CameraCount; Camera++ ) { if( IC[Camera].IsLivePrepared ) { try { IC[Camera].MemorySnapImage(1000); // Show the snapped image in a PictureBox. pictureBox1.Image = IC[Camera].ImageActiveBuffer.Bitmap; pictureBox1.Update(); } catch( ICException Ex ) { MessageBox.Show(Ex.Message, "MemorySnapImage Error"); } } } } // At the end of the application the prepared live video streams should be stopped. for( int Camera = 0; Camera < CameraCount; Camera++ ) { IC[Camera].LiveStop(); }
See also: ICImagingControl, ICImagingControl.LiveSuspend, ICImagingControl.LiveStart, ICImagingControl.LiveStop, ICImagingControl.LiveVideoRunning, ICImagingControl.IsLivePrepared

<< ICImagingControl