> How to get GdkDrawable from GdkPixbuf?

Here's one way:

1. Create an empty pixmap:

GdkPixmap *pix_work;
pix_work = gdk_pixmap_new(widget->window, xsize, ysize, -1);

2. Draw your pixbuf (which I assume you have already created) onto the pixmap:

gdk_draw_pixbuf(pix_work, NULL, pixbuf, 0, 0, 0, 0, xsize, ysize,
GDK_RGB_DITHER_NONE, 0, 0);

3. Now you can draw shapes, etc, onto your pixmap. They will draw on
top of the pixbuf that you just drew.

4. You can also go the other way (pixbuf to drawable) using
"gdk_pixbuf_get_from_drawable"

Cheers,
Chris Anderson
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to