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:
[VB.NET]
Public Event OverlayUpdate( ByVal sender As Object, ByVal e As ICImagingControl.OverlayUpdateEventArgs)
[C#]
public event System.EventHandler<ICImagingControl.OverlayUpdateEventArgs> OverlayUpdate;
Parameter Description
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, 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.

[VB.NET]
If IcImagingControl1.DeviceValid = True Then ' Check whether the overlay update event is enabled. If IcImagingControl1.OverlayUpdateEventEnable = False Then ' Enable the overlay update event. IcImagingControl1.OverlayUpdateEventEnable = True End If End If
[C#]
if (ICImagingControl1.DeviceValid) { // Check whether the overlay update event is enabled. if ( !ICImagingControl1.OverlayUpdateEventEnable ) { // Enable the overlay update event. ICImagingControl1.OverlayUpdateEventEnable = true; } }
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