Live Display: Display live video in a window

TThe following programming example shows how you can use IC Imaging Control to display a live video in a window.
Language:Visual Basic 6
Version:3.0.3
Released on:April 7, 2005
Author:IC Imaging Control Support Department
Requirements:IC Imaging Control >2.1
Camera, converter or grabber with WDM Stream Class drivers.

Image data streams to be display in live mode in a window often have to be adapted to the size of this window. The following programming example (Visual Basic) shows how you can use IC Imaging Control to "trim" the image data stream. Please note that only the image data streams representation is trimmed. Thus, the image data stream itself remains "untouched".

The sample application's window looks as follows:

The dialog window of the sample application.

The program starts by activating a built-in dialog to select a device (.ShowDeviceSettingsDialog). Before the "truing" we have to tell IC Imaging Control not to use the image data stream's default resolution (.LiveDisplayDefault). Then, we simply use the output window's height and width (.Height and .Width) to determine the size the image data stream has to be displayed with (.LiveDisplayHeight and .LiveDisplayWidth). Thereupon the device's live image data stream is displayed using .LiveStart:

Private Sub Form_Load()

    ICImagingControl1.ShowDeviceSettingsDialog

    If ICImagingControl1.DeviceValid Then

        ICImagingControl1.LiveDisplayDefault = False
        ICImagingControl1.LiveDisplayHeight = ICImagingControl1.Height
        ICImagingControl1.LiveDisplayWidth = ICImagingControl1.Width

        ICImagingControl1.LiveStart
    Else
        Unload Me
    End If

End Sub

Related Source Code Samples

Disclaimer
The source code that appears in the IC Imaging Control Source Code Library is indented for educational purposes only. The Imaging Source Europe GmbH, the manufacturer of IC Imaging Control, does not assume any kind of warranty expressed or implied, resulting from the use of the content of this page.

This site is part of The Imaging Source Network. Other sites include Company Portal, Image Processing, Astronomy Cameras, Astronomy Cameras Blog, Blog caméras d'astronomie, Astronomy Cameras Competition, TX Text Control, LiveDocx, phpLiveDocx and Forums.