LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

draw something outside pane/application.

Solved!
Go to solution

I am trying to capture the area outside the panel or application to acquire the information displayed on the commercial program.

 

While obtaining the coordinates, I want to display the area as a rectangle.

 

Mouse coordinate information for the entire screen can be obtained with mouse initialize.vi, etc.

How should I blur the entire screen and draw a picture outside the program?
(Start drawing a rectangle with the left mouse button and erase the rectangle by releasing.)

 

labmaster.

0 Kudos
Message 1 of 5
(723 Views)

I don't understand your proposed flow, but I expect you might find it tricky to draw outside of LV.

 

I would suggest minimizing your window, capturing the screen (example) and then maximizing your window to the screen and displaying the captured image in a picture control.

 

You can then handle the mouse events for the picture control to draw your rectangle. You can also blur parts of the image if that's desired.

 

 

If you really want to show it live, I would suggest displaying a picture control with color X over the entire screen, make X transparent (see this thread for an example) and then draw your rectangle in that picture control.


___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(696 Views)

Thanks tst,

 

In the 2nd part, it is very good idea for my purpose.

(The paint tool with transparent color was useless. How can I make the transparent vi?)

However, the mouse event response (selection) from Windows 10 was happened so I cannot draw it on the transparent picture. How can I freeze the response before drawing?

 

 

0 Kudos
Message 3 of 5
(661 Views)

Look into Greenshot. It already does what you're looking to do (if I understand you). I know you can have Greenshot automatically send snaps to external programs, and I'd guess you can trigger the capture remotely as well. By default it will trigger when you press the PrntScrn key on your keyboard, so there must be SOME way to trigger the snap from within LabVIEW.

 

At the very least, the program is open source, so you can see how they do what you're trying to do.

 

Edit: Here is an example program that will simulate pressing the Print Screen key: https://forums.ni.com/t5/Example-Code/Programmatically-Simulate-Key-Strokes-in-LabVIEW/ta-p/3521756

 

That might get you started.

0 Kudos
Message 4 of 5
(642 Views)
Solution
Accepted by labmaster

@labmaster wrote:

 

(The paint tool with transparent color was useless. How can I make the transparent vi?)

However, the mouse event response (selection) from Windows 10 was happened so I cannot draw it on the transparent picture. How can I freeze the response before drawing?


I forgot that SetLayeredWindowAttributes makes the transparent parts click-through and it doesn't look like it has any way to change that.

 

Looking at the Windows built-in snippet tool, I see that it also freezes the image when you invoke it, so I would suggest you do the same by following my first suggestion of taking a screenshot of the entire screen with your window minimized and then maximize your window and show the image.

 

Or use Bert's suggestion.


___________________
Try to take over the world!
0 Kudos
Message 5 of 5
(611 Views)