Re: Grab a pixmap / screenshot thing
- From: zentara <zentara1 sbcglobal net>
- To: gtk-perl-list gnome org
- Subject: Re: Grab a pixmap / screenshot thing
- Date: Tue, 7 Nov 2006 14:57:26 -0500
On Tue, 07 Nov 2006 19:00:03 +0100
Torsten Schoenfeld <kaffeetisch gmx de> wrote:
On Tue, 2006-11-07 at 10:08 +1100, Daniel Kasak wrote:
Is it possible to create a pixmap of the current desktop ... or part of
it ... using gtk2-perl?
Get the Gtk2::Gdk::Window for the root window. Create a pixbuf from it.
Save the pixbuf to disk.
use Gtk2 -init;
my $s = Gtk2::Gdk::Screen->get_default;
my $w = $s->get_root_window;
my $p = Gtk2::Gdk::Pixbuf->get_from_drawable (
$w, undef, 0, 0, 0, 0, $s->get_width, $s->get_height);
$p->save ("screenshot.png", "png");'
I don't know if that works on anything but X11, though.
Thats cool. Lightbulb goes on!!!
I wonder if it can be used in a thread, to take a series of screenshots thru a timer,
which can then be assembled into an mpg movie of the screen action. ?
I'm not really a human, but I play one on earth.
] [Thread Prev