Re: Saving a GdkDrawable/GdkPixmap to a picture file



Wolfgang Sourdeau <wolfgang contre com> writes:
"Tanikella," == Tanikella, Rajanikanth <Rajanikanth Tanikella scr siemens com> writes:

Thanks. The gkd/gtkx.h helped with the display, but I still don't see how to
get an X Pixmap from a GdkPixmap. I see GdkPixmap *gdk_pixmap_foreign_new()
to go from X Pixmap to GdkPixmap, but I'd like to go the other way so that I
can use XpmWriteFileFromPixmap() to write it. Using a GdkPixmap causes a bad
drawable error. Is there something I'm overlooking? (I'm figuring the likely
answer is 'yes.')

Including gdk/gdkprivate.h (which is evil) you can cast your GdkPixmap* to
a GdkWindowPrivate *. And then access its xwindow member.
It should work.


Use the macros in gdkx.h instead of accessing the struct directly, and
your code will continue to work with GTK 2.

Havoc




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