public final class Screenshot extends Glib
Usage is simple: given a Window, present()
it, and then call the capture
method here.
final Window window; final Pixbuf result; window.present(); result = Screenshot.capture(); result.save(...);
Note that for some reason taking screenshots is a very slow and CPU intensive process. Unfortunately, it occurs within the GDK lock and thus will block your UI for a few seconds. Threading can't help you parallelize this.
LICENCE WARNING
This native code used to take screenshots is licenced under the GNU General
Public Licence, version 2. As a result, use of this class in an application
will mean that entire application will need to be available under a GPL v2
compatible licence.
Modifier and Type | Method and Description |
---|---|
static Pixbuf |
capture()
Take a screenshot of the Window which has focus.
|
formatSize, formatSize, getProgramName, getRealName, getSystemConfigDirs, getSystemDataDirs, getUserCacheDir, getUserConfigDir, getUserDataDir, getUserName, getUserSpecialDir, idleAdd, markupEscapeText, reloadUserSpecialDirsCache, setProgramName
public static Pixbuf capture()
setDecorated(false)
on your Window). An alpha blended drop-shadow will be added for effect.