Re: [gdk] How use gdk-pixbuf...



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



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