hiWindowSaveImage
hiWindowSaveImage(
[ ?target g_target ]
[ ?path t_path ]
[ ?format t_format ]
[ ?toplevel g_toplevel ]
[ ?quality n_quality ]
[ ?delay n_delay ]
[ ?timeoutBeep g_timeoutBeep ]
[ ?grabFromScreen g_grabFromScreen ]
[ ?centralWidget g_centralWidget ]
)
=> t / nil
Description
Takes a screen capture of a window, a region, or the entire screen. You can specify the object to capture either through the arguments or, in interactive mode, by selecting it with the mouse.
If you do not specify the ?target argument, this function enters the interactive mode. You can then left-click to select a window or right-click and drag to select a region. If the ?toplevel argument is set to nil, only the widget that is clicked, such as a toolbar, is captured. When you release the mouse, a Save Image As dialog box appears that lets you specify the file in which to save the image.
You can capture a region only in interactive mode.
Arguments
|
?target g_target
|
The window, form, dialog box, or screen that you want to capture, or nil.
-
For windows, specify
window(n) or w_windowID. -
For dockable windows, specify w_dwindowID or
dwindow(n). -
For session windows, specify
swindow(n). -
For forms, specify the form symbol or r_form.
-
For a dialog box, specify the symbol that is set as the handle to the dialog box.
-
For the entire screen, specify the following symbol:
’screen#, where # is the number of the display screen. For example, ’screen0 is the first screen, and if you have multiple screens, ’screen1 is the second one, and so forth.
To interactively select the window or region that you want to capture, specify nil. The function then switches to interactive mode. You can then left-click the window that you want to capture, or right-click and drag the mouse over the region you want to capture.
Default value: nil
|
|
?path t_path
|
Path to the file in which to save the image. If you do not specify this argument, a Save Image As dialog box appears that lets you select the file.
|
|
?format t_format
|
The image format in which to save the file. You can save the file in any of the formats supported by Qt; currently these are: BMP, JPEG, PNG, PPM, XBM, and XPM. However, PNG is the recommended format.
Default value: "png"
|
|
?toplevel g_toplevel
|
|
|
Displays the top of the window hierarchy and also captures the top-level window that includes the window manager frame. Otherwise, it only captures the widget that is specified.
Default value: t
|
|
?quality n_quality
|
|
|
Number specifying the image quality for a JPEG image, if you are saving the image in JPEG format.
|
|
?delay n_delay
|
Time delay in seconds before the image is captured.
Default value: 0
|
|
?timeoutBeep g_timeoutBeep
|
|
|
Eliminates a beep when the screen capture is done if a delay is set.
Default value: t
|
|
?grabFromScreen g_grabFromScreen
|
|
|
Captures the image directly from the screen rather than drawing an image in the memory.
|
|
?centralWidget g_centralWidget
|
|
|
For session windows only grab the canvas, and for other windows and forms just grab the main section and not the window frame.
|
Value Returned
|
t
|
The screen capture was successful.
|
|
nil
|
There was an error.
|
Example
hiWindowSaveImage(?target window(1) ?path "mainWindow.png" ?format "png" ?delay 2)
hiWindowSaveImage(?target nil ?path "mySelectedRegion.png" ?format "png")
hiWindowSaveImage()
hiWindowSaveImage(?target ’screen0)
Related Topics
Screen Capture Functions
hiIsWindowSpecifier
swindow
windowp
hiCreateAppForm
hiGetCurrentForm
hiDisplayAppDBox
hiDisplayUserDBox
Return to top