Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

CWIMAQOverlay is cleared during a grab

I'm trying to display a CWIMAQOverlay in a CWIMAQViewer. I'm able to create and display the overlays fine, however every time a new frame is captured all the overlays that were created are cleared. Is it possible to keep overlays displayed during an acquisition?

0 Kudos
Message 1 of 3
(3,021 Views)
For other customers interested in this issue, here are a few things the thread starter and I have discussed checking on so far. These are the questions I previously asked the customer:

1) Are you calling CWIMAQOverlay.Clear at any point? This would clear any overlay data from the image buffer. I know this one sounds a little obvious, but it wouldn't hurt to check.
2) Are you resizing or rotating the image and therefore inadvertently clearing the buffer that way? This would produce the same effect as CWIMAQOverlay.Clear.
3) Are you disposing of your image buffer in the middle of your acquisition process? The recommended way of handling image buffers is to create the buffer once before starting your acquisition, write to it as necessary during acquisition, and then only dispose it after you are through with your acquisitions.

After covering that, we also most recently discussed checking the HasOverlay property of the image at various points in the program to see if it returned True for having an overlay even if it wasn't displaying it.
0 Kudos
Message 2 of 3
(3,003 Views)
To clear things up for other customers: the overlay being cleared upon each acquisition is normal, expected behavior.

If you'd like to keep your overlay between acquisitions, you can either redraw the same overlay on after the next acquisition takes place, or you can copy the overlay to a second image buffer and then copy the overlay back to the first image once the new acquisition has been taken.
0 Kudos
Message 3 of 3
(2,975 Views)