ICImagingControl.ImageAvailable Method [Deprecated]

This event is called each time a frame has been copied completely to the internal ring buffer.
Syntax:
[C#]
public event System.EventHandler<ICImagingControl.ImageAvailableEventArgs> ImageAvailable;
Parameter Description
BufferIndex

Specifies the index to an image buffer in the ring buffer for which the event is called.

sender

The object in which the event occurred. In this case the appropriate instance of ICImagingControl.

e

An ImageAvailableEventArgs object containing the index of the buffer for which the event is called.

Limitations:

Before the ImageAvailable event will be fired, ICImagingControl.LiveCaptureContinuous must be set to True, the control must run in live mode and an event sink has to be registered.

Remarks:

Inside an event procedure no Windows API functions should be called which cause a SendMessage (i.e. adding text to an edit box) because this may block the application.

While an event procedure is running, no new events are sent, but frames are still copied.

Exceptions that occur in the ImageAvailable event will get lost in the system. Therefore, bugs in the code that cause an exception cannot be recognized. To avoid this, use an On Error Goto ... statement. The On Error Goto ... statement should be put at the beginning of the event handler.If you need to display error messages, do not use a message box. Use a "debug trace" instead (e.g. Debug.Print ... ). This is very important, because otherwise the system may run into a deadlock which will cause the application to hang.

Exceptions that occur in the ImageAvailable event will get lost in the system. Therefore, bugs in the code that cause an exception cannot be recognized. To avoid this, all code in the event handler should be enclosed by a try ... catch block. If you need to display error messages, do not use a message box. Use a "debug trace" instead (e.g. System.Diagnostics.Trace.WriteLine(...) ). This is very important, because otherwise the system may run into a deadlock which will cause the application to hang.

Information:

This event is deprecated since version 3.5.
Use the actual sink object.

Sample:

This example implements an event procedure for the ImageAvailable event. In the event procedure an ImageBuffer object is declared, which is used to take the image, for that the event has been called.

See the Displaying Buffers via FrameQueueSink example.

See also: ICImagingControl, ICImagingControl.LiveCaptureContinuous

<< ICImagingControl