Micah Carrick wrote:
You have to create the GtkImage first...
Code:
gtk_image_new_from_file (gtk_image, "1.jpg");
As far as your two calls... why are you calling this? You've already set the image by filename.
gdk_draw_image. I'm assuming you're trying to draw the image onto a GdkPixmap you have defined elsewhere named "pixmap"?
Try this maybe... (just guessing here):
Code:
GtkImage *gtk_image = NULL;
GdkImage *gdk_image = NULL;
gtk_image_new_from_file (gtk_image, "1.jpg");
gtk_image_get_image (gtk_image, &gdk_image, NULL);
gdk_draw_image (pixmap, widget->style->white_gc, gdk_image,
0, 0, 60, 60, 100, 100);
Thank you for your help..
but gtk_image_new_from_file() is called as
gtk_image = gtk_image_new_from_file("1.jpg"); //here the return value should be GtkWidget
if I define gtk_image as [GtkWidget *gtk_image = NULL] it is giving waring as
warning: passing arg 1 of `gtk_image_get_image' from incompatible pointer type. as gtk_image_get_image() is expecting GtkImage as 1st argument
not GtkWidget.
while running the program I'm not getting any image and getting these errors...
(scribble-simple:2996): Gtk-CRITICAL **: gtk_image_get_image: assertion `image->storage_type == GTK_IMAGE_IMAGE || image->storage_type == GTK_IMAGE_EMPTY' failed
(scribble-simple:2996): Gdk-CRITICAL **: gdk_draw_image: assertion `image != NULL' failed
(scribble-simple:2996): Gdk-DirectFB-WARNING **: gdk_window_set_keep_above() not implemented.
(scribble-simple:2996): Gdk-DirectFB-WARNING **: gdk_window_set_keep_below() not implemented.