ICImagingControl.OverlayUpdate Event |
||||||||||||||||||||
This event is called after a new frame has been delivered by the video capture device. | ||||||||||||||||||||
Syntax: | Private Sub OverlayUpdate(ByVal Overlay As ICImagingControlCtl.OverlayBitmap, _ ByVal SampleStartTime As Double, _ ByVal SampleEndTime As Double ) |
|||||||||||||||||||
|
||||||||||||||||||||
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. |
|||||||||||||||||||
Sample: | This example demonstrates how to write a frame counter on the live video. FrameCount is a global declared variable in the form. Private Sub ICImagingControl1_OverlayUpdate(ByVal Overlay As ICImagingControlCtl.OverlayBitmap, _ ByVal SampleStartTime As Double, _ ByVal SampleEndTime As Double) FrameCount = FrameCount + 1 Overlay.DrawText RGB(255, 255, 0), 0, FrameCount End Sub |
|||||||||||||||||||
See also: | ICImagingControl, OverlayBitmap, ICImagingControl.LiveStart, ICImagingControl.ReferenceTimeStart, ICImagingControl.ReferenceTimeCurrent |