Image Acquisition: Acquiring an image

The following programming example shows how you can use IC Imaging Control to take and display a single image.
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 sample application's window looks as follows:

The Testdialog of IC Imaging Control,

The following programming example (Visual Basic) shows how you can use IC Imaging Control to grab an image from a device's live image data stream and to write it into a buffer.

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 windows "IC Imaging Control Live Video" on the right):

Private Sub Form_Load()
    ICImagingControl1.ShowDeviceSettingsDialog

    ICImagingControl1.LiveStart
End Sub

When the user clicks "Capture", .MemorySnapImage grabs an image from the image data stream and writes it into an internal ring buffer. Now you are able to access this image: .ImageBuffers.CurrentIndex indicates the position of the last image which has been written into the ring buffer. .ImageBuffers(index) provides an object ImageBuffer containing this image. Simply use a Picture control to display it (see windows "Acquired Image" on the right):.

Private Sub btnCapture_Click()
    ICImagingControl1.MemorySnapImage

    Dim buffer As ImageBuffer
    Set buffer = ICImagingControl1.ImageBuffers(ICImagingControl1.ImageBuffers.CurrentIndex)

    Picture1.Picture = buffer.Picture
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.