ICImagingControl.OverlayUpdate Event |
||||||||||||||||||||||||||
This event is called after a new frame has been delivered by the video capture device. | ||||||||||||||||||||||||||
Syntax: | [C#] |
|||||||||||||||||||||||||
|
||||||||||||||||||||||||||
Remarks: | The OverlayUpdate event is called after a new frame is available. In the OverlayUpdate event sub, text or graphical elements can be drawn in the new frame. Therefore, it is possible to insert individual information on each individual frame. The sample time is the time that has been passed, since ICImagingControl.LiveStart has been called. The time resolution is seconds. The duration between SampleStartTime and SampleEndTime is equal to the current frame rate. This event is called before the ICImagingControl.ImageAvailable event occurs. Exceptions that occur in the OverlayUpdate 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 ... construct. 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 OverlayUpdate 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. |
|||||||||||||||||||||||||
Sample: | This example demonstrates how to write a frame counter on the live video. FrameCount is a global declared variable in the form. [C#] |
|||||||||||||||||||||||||
See also: | ICImagingControl, OverlayBitmap, ICImagingControl.LiveStart, ICImagingControl.ReferenceTimeStart, ICImagingControl.ReferenceTimeCurrent |