06-22-2023 04:53 AM
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.
Solved! Go to Solution.
06-22-2023 06:47 AM
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.
06-22-2023 09:37 AM
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?
06-22-2023 03:32 PM - edited 06-22-2023 03:39 PM
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.
06-25-2023 01:43 AM
@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.