how to convert a GdkPixmap to GdkDrawable



I try to copy the specific area of a GdkWindow to a GdkPixmap for
further use.
I first create a GdkPixmap using gdk_pixmap_new(..)
then I copy the specific area of a GdkWindow to a GdkImage by using
image=gdk_image_get(gdkwindow,...)
Then, I try to use gdk_draw_image to draw the GdkImage to the GdkPixmap.

but eh gdk_draw_image needs the first parameter to be GdkDrawable
        gdk_draw_image(GdkDrawable *, ...)

In the online Gtk Tutorial 23.3, it said GdkPixmap is GdkDrawable and
even show an example.
But when I compile my program, it shows error message which is "can not
convert from GdkPixmap * to GdkDrawable *).

So I wonder how to convert a GdkPixmap * to GdkDrawable *
Or, is there some easy ways to copy a specific area of a GdkWindow to a
GdkPixmap?

Thanks

Jiang



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