ICImagingControl.MemorySnapImage Method [Deprecated]

This method captures a still image from a live video stream.
Syntax:
[C#]
Public void MemorySnapImage(); Public void MemorySnapImage( int timeoutInMs );
Parameter Description
timeoutInMs

Specifies the snap timeout value in milliseconds.

Remarks:

This method captures a still image from a live video stream and stores it in the ring buffer. The buffer can be saved to a file using the ICImagingControl.MemorySaveImage Method.

If the live video stream is already running, then the maximum duration of MemorySnapImage is double of the frame rates time interval. MemorySnapImage captures the next new provided image from the live video stream.

If the live video stream was not started before a call of MemorySnapImage, then the live video stream is started in MemorySnapImage automatically. An image will be captured and the live video stream is stopped automatically. If MemorySnapImage is called often in an application, then this sequence of start - snap - stop can be very time expensive. Thus, it is better to call LiveStart once in the application and stop the live video stream when the application ends.

When LiveCaptureContinuous is true, MemorySnapImage throws an ICException with the error code ICException.ErrorCodes.NotAvailableOutsideSnapMode.

If no image was provided by the video capture device in the timeout time an exception is thrown.

If an external triggered camera is in use, then MemorySnapImage should be avoided, because it blocks the application until it returns. For triggered cameras the ImageAvailable event should be used.

Information:

This method is deprecated since version 3.5.
Use the methods on the actual sink

Sample:

The following code snippet shows how to snap an image from the video live stream using a timeout of 1000ms. The snapped image will be shown in a PictureBox:

[C#]
ICImagingControl1.LiveStart(); try { // Use a timeout of 1000ms. ICImagingControl1.MemorySnapImage(1000); // Show the snapped image in a PictureBox. pictureBox1.Image = ICImagingControl1.ImageActiveBuffer.Bitmap; } catch( ICException Ex ) { MessageBox.Show(Ex.Message, "MemorySnapImage Error"); } ICImagingControl1.LiveStop();
See also: ICImagingControl, ICImagingControl.MemorySaveImage, ICImagingControl.ImageActiveBuffer, ICException.ErrorCodes

<< ICImagingControl