IC Imaging Control .NET

ICImagingControl.OverlayUpdate Event

ICImagingControl.OverlayUpdate Event

This event is called after a new frame has been delivered by the video capture device.
Syntax:
[C#]
public event System.EventHandler<ICImagingControl.OverlayUpdateEventArgs> OverlayUpdate;
Parameter Description
Overlay

Specifies the Imaging Controls OverlayBitmap object

SampleStartTime

Specifies the sample start time in seconds. See remarks section for more information.

SampleEndTime

Specifies the sample end time in seconds. See remarks section for more information.

sender

The object in that the event occurred, in this case the appropriate instance if ICImagingControl.

e

An OverlayUpdateEventArgs object containing the scroll information.

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#]
private void ICImagingControl1_OverlayUpdate( object sender, TIS.Imaging.ICImagingControl.OverlayUpdateEventArgs e ) { FrameCount = FrameCount + 1; e.overlay.DrawText(System.Drawing.Color.Orange, 0, 0, FrameCount.ToString()); }
See also: ICImagingControl, OverlayBitmap, ICImagingControl.LiveStart, ICImagingControl.ReferenceTimeStart, ICImagingControl.ReferenceTimeCurrent

<< ICImagingControl

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us