LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ line ROI - Straight Lines

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 

0 Kudos
Message 1 of 14
(2,924 Views)

Imaq overlay line

0 Kudos
Message 2 of 14
(2,891 Views)

 

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,

 

Keyboard EventKeyboard Event

0 Kudos
Message 3 of 14
(2,884 Views)

Thanks SabariSaravanan.M.

Could you please add the vi attachment in LabVIEW 2013?

 

Keyboard Event.png

0 Kudos
Message 4 of 14
(2,877 Views)
0 Kudos
Message 5 of 14
(2,862 Views)

Thank you SabariSaravanan.M

 

How does this work exactly?

I may be missing something here.

 

- Sable

0 Kudos
Message 6 of 14
(2,853 Views)

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

0 Kudos
Message 7 of 14
(2,841 Views)

Hello SabariSaravanan.M,

 

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

0 Kudos
Message 8 of 14
(2,837 Views)

Try out this!

 

0 Kudos
Message 9 of 14
(2,834 Views)

Hi SabariSaravanan.M,

 

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

0 Kudos
Message 10 of 14
(2,820 Views)