AcquiredImage Event

NI Vision for Visual Basic

AcquiredImage Event

Syntax

Sub ControlName_AcquiredImage(ImageIndex)

Applies To

CWIMAQ

Purpose

Fires when the image acquisition device acquires the specified number of images. CWIMAQ generates this event only for acquisitions that you initiate with the Start method.

Remarks

When using the CWIMAQ control, set its properties, and then call the Start method to begin an asynchronous acquisition. CWIMAQ calls the AcquiredImage event procedure as your image acquisition device acquires images if the AcquiredImageEnable property is set to True.

This event is only fired for asynchronous acquisitions.

Parameters

ImageIndex As Variant

The index of the image in the Images collection that your image acquisition device acquired.

Example

' This example requires you to have the following controls on the form:
' 1) A button named Acquire.
' 2) A button named Stop.
' 3) A Textbox named Text1
Private Sub Acquire_Click()
    ' Attach the viewer to the first item of the Images
    ' collection
    CWIMAQViewer1.Attach CWIMAQ1.Images.Item(1)
    ' Make the acquisition continuous.
    CWIMAQ1.AcquisitionType = cwimaqAcquisitionContinuous
    ' Start the acquisition
    CWIMAQ1.Start
End Sub

Private Sub Stop_Click()
    ' Stop the acquisition
    CWIMAQ1.Stop
End Sub

Private Sub CWIMAQ1_AcquiredImage(ImageIndex As Variant)
    ' Display the ImageIndex in the text box.
    Text1 = ImageIndex
End Sub

See Also

Images

ImagesPerEvent