Re: Saving a GdkDrawable/GdkPixmap to a picture file



Tom Aziz <tomazi caramail com> writes:

I'm trying to save a GdkPixmap (or GdkDrawable ?) to a 
picture file, like jpeg or png. What is the more simple way 
to do that ?
Is it included in GTK+ or not ? Or a separate lib like 
libjpeg (I've heard about it, is that the right one ?)

(Thanks with colormap, it works fine.)


Remember the drawable is server-side and in a format specific to your
video card. So it's hardly a convenient representation for this kind
of thing.

That said, you might use the GdkPixbuf library and
gdk_pixbuf_get_from_drawable(), then you can use libpng to save the
RGB data. GTK 2 beta (1.3.4) contains a gdk_pixbuf_save() function you
could copy, but I don't think gdk-pixbuf 1.0 contains it.

Havoc




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