John Lokanis Posted July 12, 2008 Report Share Posted July 12, 2008 Here is a quick VI using .NET that will take a screenshot of the primary workspace and save it to a file. This is setup to save the file as a png, but you can easily change it to whatever you want. The VI will hide itself if it is open so it does not appear in the screenshot. Let me know if you find this useful or if I have any bugs. My purpose for this VI was to be able to prgrammatically grab a screenshot of apps I distrubute so I can see what is going on if a user has a question or there is an error. I'm sure there are many other uses. -John (written in LV8.5) Quote Link to comment
TobyD Posted July 12, 2008 Report Share Posted July 12, 2008 QUOTE (jlokanis @ Jul 11 2008, 01:20 PM) Here is a quick VI using .NET that will take a screenshot of the primary workspace and save it to a file. I did something similar a while ago but with a different approach. I simulated a "print screen". Yours seems a bit more robust and doesn't use unsupported functionality. :thumbup: The hide FP is also a nice touch. It's worth noting that the Code Capture Tool can do this as well. Here's the one I did. Download File:post-8758-1215814713.vi Quote Link to comment
John Lokanis Posted July 15, 2008 Author Report Share Posted July 15, 2008 QUOTE (TobyD @ Jul 11 2008, 03:23 PM) I did something similar a while ago but with a different approach. I simulated a "print screen". Yours seems a bit more robust and doesn't use unsupported functionality. :thumbup: The hide FP is also a nice touch.It's worth noting that the Code Capture Tool can do this as well. Here's the one I did. Download File:post-8758-1215814713.vi That is nice, but it requires access to scripting and uses the clipboard, clearing anything that might be in there already. Unfortunately, I don't have 'scripting' capability in LV8.5. I like how you added the feature to grab either the whole screen or active window. If it is a LV window, there is already a function in LV to grab the FP as an image, bit if the window is some other app, then that could be useful. My code could be modified to grab the active window, but that would mean detecting the active window and then getting it's coordinates. My goal is to create a web page that will serve the most recent image and will allow me to 'take a snap' of the screen on demand. I think there is a way to do this in ASP.NET using shared variables but I have a lot to learn in this area... -John Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.