Re: Desktop screenshot



On Mon, 2010-04-26 at 13:37 +0200, Andy Bell wrote:
> Hi,
> 
> 
> I am trying to get a screenshot of the desktop by using a transparent
> GtkWidget and then using gdk_pixbuf_get_from_drawable.   When I check
> the saved GdkPixbuf I am getting a valid image, but the image does not
> include the background of the desktop but just the GtkWidget itself.
> Is there any way of working around this?

Why not simply doing something like this?

window = gdk_get_default_root_window ();
gdk_drawable_get_size (window, &width, &height);
image = gdk_pixbuf_get_from_drawable (NULL, window,
                                      gdk_drawable_get_colormap(window),
				      0, 0,
				      0, 0,
                                      width, height);


Claudio


-- 
Claudio Saavedra <csaavedra gnome org>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]