[Gambas-user] Grab command

Benoît Minisini gambas at ...1...
Mon Apr 23 11:07:49 CEST 2012


Le 19/04/2012 19:01, trat50 a écrit :
>
> I would like some help the syntax of the Grab command.
> I want to save a DrawingArea as a png or jpg file.
> Would someone please post a short example. Thank you.

The Grab() method is reliable only when grabing the entire desktop. If 
you grab a control, X-Window may or may not return what you see on the 
screen. Normally, if the control window is not covered, you get it.

But...

1) If you use a composited desktop, I don't know what happens then.

2) Moreover, QT4 and GTK+ now do not use one window by control anymore, 
so they internally emulate the old behaivour. But I don't know how 
(maybe by maintaining a big image buffer for each top-level window, or 
by redrawing the control inside a picture).

So, personnally, I suggest never using the Grab() method on a control. I 
may remove it in the future.

-- 
Benoît Minisini




More information about the User mailing list