How to create a GdkImage from a file.

I want to genetate a GdkImage from a file .. (so that this GdkImage can be passed to gdk_draw_image())
I used following calls..

GtkImage *gtk_image = NULL;
GdkImage *gdk_image = NULL;
GdkBitmap *gdk_bitmap = NULL;

gtk_image_set_from_file (gtk_image, "1.jpg");
gtk_image_set_from_image (gtk_image, gdk_image, gdk_bitmap);
gdk_draw_image (pixmap,  widget->style->white_gc,  gdk_image,
                              0, 0,  60, 60, 100, 100);

but while running the appliction I'm getting following error..
 Gtk-CRITICAL **: gtk_image_set_from_file: assertion `GTK_IS_IMAGE (image)' failed

can anyone tell what is the problem.

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