hwISession CaptureScreenToSize
Captures the current screen to an image file of the specified pixel resolution.
Syntax
hwISession_handle CaptureScreenToSize type, filename, height, width, quality
Application
HyperWorks Tcl Query
Inputs
- type
- The type of file. Options include: BMP, JPEG, TIFF, PNG, Clipboard
- filename
- The filename of the captured image.
- width (Optional)
- The width of the captured image in pixels (default in batch mode is 1024, otherwise default is value returned by hwISession::GetPageWidth).
- height (Optional)
- The height of the captured image in pixels (default in batch mode is 768, otherwise default is value returned by hwISession::GetPageHeight).
- quality (Optional)
- The level of quality or compression (default is 100). This is used only in JPEG type captures.
Examples
hwi GetSessionHandle sess;
sess CaptureScreenToSize png MyPicture.png 1600 1200;
hwi GetSessionHandle sess;
sess CaptureScreenToSize jpeg MyPicture.jpg 1600 1200 60;
hwi GetSessionHandle sess1
sess1 CaptureScreen "clipboard" E:\Scratch\CaptureScreenAPI_Test 1600 1200 100;
Error
Success (0) or an error code.