아래의 제품을 비롯한 NI 소프트웨어를 다운로드하시려면 ni.com/downloads를 방문하십시오.
This example uses calls from the Windows user32.dll to programmatically take a screenshot, access the image stored in the clipboard, and save the image to a file. This method can be used in a deployed application whereas innate LabVIEW methods (Clipboard.Get Image) as not available at run-time and cannot be used in an executable.
Steps to Implement or Execute Code
**Note that the VI must be set to run in a single thread (run in UI thread).**
NI 커뮤니티에 있는 예제 코드 교환의 예제 코드는 MIT 라이센스로 라이센스가 부여됩니다.
Hi, I'm trying to run this on LV2011F2 and get this error when tryign to save:
Error calling method System.Drawing.Image.Save, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.) <append><b>System.Runtime.InteropServices.ExternalException</b> in PrintScreen-LV86-4.vi
Any ideas? This happens with both the VI and a compiled executable. I do have the execution set to UI. Thanks.
For anyone who experienced it, in order for this to work in runtime environment, you have to set up the Call Library function node the way that this thread shows:
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.