Live Display: Full screen video

The following programming example shows how you can use IC Imaging Control to display a full screen video.
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 full screen mode often have to be adapted to the screen's size. 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). At the end of the function (Form_Load()) this device's live image data stream is displayed using .LiveStart. 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 screen's height and the width (.Height and .Width) to determine the size the image data stream has to be displayed with (.LiveDisplayHeight und .LiveDisplayWidth):

Private Sub Form_Load()
    ICImagingControl1.ShowDeviceSettingsDialog

    If Not ICImagingControl1.DeviceValid Then
        Unload Me
        Exit Sub
    End If

    Me.WindowState = vbMaximized

    Me.KeyPreview = True
    Me.ScaleMode = vbPixels

    ICImagingControl1.LiveDisplayDefault = False
    ICImagingControl1.LiveStart

    Timer1.Enabled = False
    Timer1.Interval = 1
End Sub

The full screen mode is terminated by a mouse click (ICImagingControl1_MouseUp). Please note that it is not allowed to use Unload Me in the context of this event handler. Start a timer instead that terminates the program after one second:

Private Sub ICImagingControl1_MouseUp(ByVal Button As Long, ByVal Shift As Long, ByVal XPos As Integer, ByVal YPos As Integer)
    Timer1.Enabled = True
End Sub

Obviously, it is also possible to leave the full screen mode by pressing a key. This can be done by setting the property .KeyPreview to True and using the following function to respond to the ESC key:

Private Sub Form_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyEscape Then
        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.