Opening and Handling Devices: Use Built-In Property Dialog Boxes

Short code snippet that illustrates how to modify device properties using the property dialog box that ship with IC Imaging Control.
Language:.NET C#/Visual Basic
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.

IC Imaging Control allows devices settings, such as "Brightness", "Contrast" or "Exposure Time" to be adjusted, using shipped dialog boxes. This brief source code sample illustrates how to carry out such adjustments.

The window of the resulting application looks as follows:

The property dialog of the sample application.

The property pages look as follows:

The dialog window of the sample application.

The dialog window of the sample application.

The dialog window of the sample application.

The dialog window of the sample application.

The program starts by opening the built-in dialog that allows the user to select a video capture device (.ShowDeviceSettingsDialog). At the end of the function Form1_Load(), the live image data stream from the video capture device is displayed, using .LiveStart.

[C#]
private void Form1_Load(object sender, System.EventArgs e)
{
    icImagingControl1.ShowDeviceSettingsDialog();

    if( icImagingControl1.DeviceValid )
    {
        icImagingControl1.LiveStart();
    }
    else
    {
        Close();
    }
}
[VB.NET]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    IcImagingControl1.ShowDeviceSettingsDialog()

    If IcImagingControl1.DeviceValid Then
        IcImagingControl1.LiveStart()
    Else
        Me.Close()
    End If
End Sub

When the user clicks "Properties...", the program activates the built-in dialog (.ShowPropertyDialog()) to adjust the device settings:

[C#]
private void btnProperties_Click(object sender, System.EventArgs e)
{
    if( icImagingControl1.DeviceValid )
    {
        icImagingControl1.ShowPropertyDialog();
    }
}
[VB.NET]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    IcImagingControl1.ShowPropertyDialog()

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.