ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving an overlay which was created programmatically

I created an overlay on an image using the following function:
 
CWIMAQViewer1.Image.Overlays(1).DrawRectangle rRect, cwimaqOverlayModeFrame, vbBlue
 
I would like to have the user "grab" the rectangle with the mouse and reposition it on the image where he wants it to be.
 
Can this be done?
 
Thanks!
0 Kudos
Message 1 of 2
(3,293 Views)
Steverino -

Sure!  To let the user interact with the rectangle, you have to make it part of the viewer region instead of an overlay, like

CWIMAQViewer1.Regions.DefaultRegionColor = vbBlue
CWIMAQViewer1.Regions.AddRectangle rrect
CWIMAQViewer1.Tool = cwimaqToolSelection


Greg Stoll
Vision R&D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 2 of 2
(3,292 Views)