05-27-2019 09:56 AM
Hi,
When I select the line tool button on an IMAQ image, I have the option to draw a perfectly straight horizontal or vertical line by holding down the "Shift" key and dragging the mouse.
How can I program a similar function with LabVIEW?
- Sable
05-28-2019 12:23 AM
Imaq overlay line
05-28-2019 01:13 AM
If you wanna draw multiple of lines on same image you may use user32.dll file(with call library function node) to hold down the shift key by programmatically.
Try it from as follows snippet,
05-28-2019 03:03 AM
05-28-2019 04:28 AM
Here you go
05-28-2019 08:20 PM
05-29-2019 01:28 AM
Hello Sable,
I forgot to say loading a user32.dll from PC, double click on call library function node and select root directory
from C:\Windows\System32\user32.dll here.
This is how use to work flow,
Step1: key down event to be before starting the process
Step2: Use your code here and draw how many lines you want
Step3: Key up event to be after ending the process
05-29-2019 06:06 AM
Hello SabariSaravanan
I am still unable to figure it out. I've attached a simple vi to test the functionality.
Could you please show me what I am doing wrong?
By the way, my objective is to program the "Shift" key down (hold) + Mouse drag that allows the user to draw a perfectly straight horizontal (or) vertical line in IMAQ using the ROI line tool.
- Sable
05-29-2019 07:09 AM
Try out this!
05-29-2019 08:41 PM
Thank you but the vi doesn't work as intended. Shift key by default works for an IMAQ image, even without any code.
When I change it to ctrl key instead, I am unable to draw a perfectly straight line.
- Sable