This function takes a screen shot of the project screen and saves it to an image file.
Function | Group | Execution | Windows | Embedded | Thin Client |
---|---|---|---|---|---|
SaveScreenShot | Graphic | Synchronous | Supported | Supported (only for open screens) | Executed on Server |
For projects running on Windows, the screen may be either open or closed. For projects running on Windows Embedded, the screen must be open.
This is an optional parameter; if no value (or "") is specified, then the currently open and active screen is used.
This is an optional parameter; if no value is specified, then either the value of optStrScreenName or simply ScreenShot.jpg is used.
Value | Description |
---|---|
0 | BMP |
1 | JPG |
2 | PNG |
3 | GIF |
4 | TIFF |
5 | Auto |
This is an optional parameter; if no value is specified, then the default is 1 (JPG).
Value | Description |
---|---|
-1 | Wrong number of parameters. |
-2 | Wrong parameter types. |
-3 | Invalid directory. |
-4 | Second parameter cannot be empty. |
-5 | Wrong format / invalid option for third parameter. |
-6 | Failed to save file. |
-7 | Failed to create compatible bitmap. |
0 | Success. |
The Viewer task must be running for this function to be executed. The function can be called by the Background Task (e.g., by a Script or Math worksheet), but it will fail if the Viewer task is not running.
SaveScreenShot()
SaveScreenShot( "main.scr" )
SaveScreenShot( "", UserName, 0 )