
| 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. |
| |
The following program shows how you create an timed stop AVI file with IC Imaging Control.
The sample application's window looks as follows:

The program starts by activating a built-in dialog to select a device (.ShowDeviceSettingsDialog). Then, this device's live image data stream is displayed using .LiveStart (see dialog on the right):
Private Sub Form_Load() ICImagingControl1.ShowDeviceSettingsDialog If Not ICImagingControl1.DeviceValid Then Unload Me Exit Sub End If ICImagingControl1.LiveStart End Sub
When the user clicks "Start Capture", the program stops the image data stream (.LiveStop) and starts the AVI file's recording as well as a timer (.AviStartCapture, Timer1.Enabled = True):
Private Sub cmdStartCapture_Click() ICImagingControl1.LiveStop ICImagingControl1.AviStartCapture "video.avi", "DV Video Encoder" recordedTime = 0 Timer1.Enabled = True cmdStartCapture.Enabled = False End Sub
The AVI recording is controlled by a timer. Being called periodically by the timer Timer1, the event handler Timer1_Timer() reads the recording time defined by the user (txtStop.Text), indicates the expired time (lblRecorded.Caption), terminates the recording after the expiration of the defined time (.AviStopCapture) and restarts the live image data stream (.LiveStart):
Dim recordedTime As Long Private Sub Timer1_Timer() recordedTime = recordedTime + 1 lblRecorded.Caption = "Recorded: " & recordedTime & " s" Dim stopTime As Long stopTime = txtStop.Text If recordedTime >= stopTime Then Timer1.Enabled = False ICImagingControl1.AviStopCapture ICImagingControl1.LiveStart cmdStartCapture.Enabled = True End If End Sub
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.