Depends on the widget:
For generic widgets there is gtk_widget_get_snapshot (
http://library.gnome.org/devel/gtk/stab ... t-snapshot) which outputs to a gdkpixmap
However if its a widget you've custom made with cairo you can draw it to various image formats, thus both vector and pixel based images are possible.
Gtk3 is moving away from gdkpixmaps so the cairo option is preferable. I think it may be possible to also use in the generic case by getting the widget into the surface to be used by a cairo context.