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.3
Author:IC Imaging Control Support Department

Requirements:
Software:IC Imaging Control 3.3, Visual Studio™ 2010
Hardware:Camera, converter or grabber with WDM Stream Class drivers.
Download C# sampleUsing Prepared Property Dialog - C#
Download VB7 sampleUsing Prepared Property Dialog - VB7

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