Attach Method

NI Vision for Visual Basic

Attach Method

Syntax

CWIMAQViewer.Attach SourceImage

Purpose

Attaches a CWIMAQImage object to the viewer.

Remarks

Attaching a CWIMAQImage object to the viewer displays the image in the viewer and allows you to access the object through the Image property. The previously attached image is destroyed if there are no references to it.

A CWIMAQViewer displays the current data inside its Image sub-objects if the data is modified by an image processing function or at a high rate due to an image acquisition. The Attach method allows you to set up a dynamic link between a viewer and an image that causes the viewer to update when the image changes.

Parameters

SourceImage As CWIMAQImage

The image to attach.

Example

' An example of a CWIMAQViewer attaching to
' a CWIMAQImage in an acquisition

Private Sub Run_Click()
   CWIMAQViewer1.Attach CWIMAQ1.Images(1)
   ' The CWIMAQImage object is now shared
   ' between the CWIMAQViewer1 and CWIMAQ1
   ' objects

   CWIMAQ1.Start
   ' CWIMAQ1 is now acquiring data.  As new images
   ' are acquired, CWIMAQViewer1 automatically
   ' updates to display them.
End Sub

See Also

Image