Re: How to get a GtkWidget in to pixbuf
- From: "Kalle Vahlman" <kalle vahlman gmail com>
- To: "sadhees kumar" <sadheeskumar gmail com>
- Cc: gtk-devel-list gnome org
- Subject: Re: How to get a GtkWidget in to pixbuf
- Date: Thu, 27 Apr 2006 21:44:37 +0300
On 4/27/06, sadhees kumar <sadheeskumar gmail com> 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, zuh iki fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]