On 4/27/06, sadhees kumar <[EMAIL PROTECTED]> wrote:
>                         In short I would like to know how to take a
> GtkWidget in to a pixbuf.
>
>                        I tried the command gdk_pixbuf_get_from_drawable(),
> but in vain. It would be very helpfull if anybody suggest me with some
> example code.

I think that should work when you give the widgets GdkWindow (which is
a GdkDrawable) as the parameter, which is accessible as
widget->window.

So something like

pixbuf = gdk_pixbuf_get_from_drawable (NULL, widget->window, NULL,
widget->allocation.x, widget->allocation.y, 0, 0,
widget->allocation.width, widget->allocation.height);

should work as you want. The use of allocation for coordinates is in
case the widget  has not got a window of it's own (in that case
widget->window points to its parent widgets window).

--
Kalle Vahlman, [EMAIL PROTECTED]
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list

Reply via email to