Simon,
When you attach an acquision buffer to the viewer, then you cannot make any changes to the image (eg. overlays), because the acquisition process has the buffer locked or protected.
If you want to make changes to the live display of an acquisition, simply make a copy of the acquisition buffer to a user defined buffer and attach the copy to the viewer as shown below. We can now add overlays to the image without affecting the acquisition process. This is just one example of the low level acquisition control that the NI-IMAQ allows.
For flicker-free updates of the overlays, be sure to set "immediate updates" to false in the in the viewer properties.
Dim myImage As New CWIMAQImage
CWIMAQVision1.Copy CWIMAQ1.Images(ImageIndex), myImage
CWIMAQViewer1.I
mage.Overlays(1).DrawText Origin, Options, Text
CWIMAQViewer1.Attach myImage
Regards,
Brent R.
Applications Engineer
National Instruments