Desktop.Grab
(gb.qt)
Syntax
STATIC FUNCTION Grab ( ) AS Picture
Makes a desktop screenshot and returns it as a picture.
This example shows how you could grab a screenshot of your desktop and store it in a Picture object. This example assumes it is run from a Button on a Form and that you do not want the current form to show in the screenshot.
Examples
' Holds the screen image
PRIVATE screenshot AS Picture
PUBLIC SUB ButtonScreenshot_Click()
' Hide the current form so it is not
' seen in the screenshot
ME.Visible = FALSE
' Give the current form a chance to hide
WAIT 0.5
' Get screenshot
screenshot = Desktop.Grab()
' Show the current form again
ME.Visible = TRUE
END