From Widget to Pixbuf
Need to grab a screenshot in your program? Or maybe you
just need to create an image from an existing
GtkWidget. There's an easy way to
accomplish both tasks using
To use the method you'll need two things - an empty
GdkPixbuf and the "drawable"
GdkDrawable) associated with your widget.
Most widgets will have a
$widget->window. You can get the
entire screen, however, by using
Now for the code examples...