LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ line ROI - Straight Lines

You want to draw the line manually or programatically?
-If Manually by holding the shift key and drawing the line is easier without additional coding.
-If Programtically then you need to know the starting point from where you need to draw the line and end point you can calculate by adding X and Y as required in Horizontal or Vertical.
-For E.g., if your starting point is (200,200) and you want the line in Vertical then endpoint is something like (500,200)
-Another idea is once the line is drawn, then modify the end point X or Y based on your required Horizantal or Vertical line with respect to Starting point.
Thanks
uday
0 Kudos
Message 11 of 14
(385 Views)

I do not want to draw the line (from start to end) programatically.

 

Whenever we draw a line for the first time with the IMAQ line tool, we are able to draw a perfectly straight line while holding down the shift key + mouse drag. This works even without the vi running.

 

I want to know how this function (holding down the shift key to force the user to draw a perfectly straight line) is done and replicate it.

 

- Sable

0 Kudos
Message 12 of 14
(380 Views)

-First thing is identifying the Key Press and add logic after that event.
-If you can check the Key Navigation and Key focus it might help.
-The Monitoring Keyboard and Mouse Activity.vi in the examples and https://forums.ni.com/t5/Example-Programs/Hotkeying-and-Key-Navigation-Using-Key-Presses-to-Control-... will give some understanding of how to add HotKeying.

Thanks
uday
0 Kudos
Message 13 of 14
(371 Views)

Thank you udka

I am wondering if the function uses a windows .dll that I can set during the Key Press event and release during the Key Up event?

 

- Sable

0 Kudos
Message 14 of 14
(364 Views)