question about gdk_imlib_save_image



Dear Sirs,
I have read the dicusssion about saving pixmap to a file in the maillist of gtk.
And I also read the imlib programmer guides .
Now I am trying to use this function when I click the button.
Here is the problem: pixmap is saved to file successfully(file is really existing), but i can't see anything related to my pixmap when i open this file.
Could anyone please help me figure the bugs out?
 
Best Regards,
Calvin Chen
 
 
brief code as follow:
**********************************************************************************
void button_clicked(GtkWidget *button, GtkWidget *window)
{
    GdkPixmap *strmap = NULL;
   GdkImlibImage *image = NULL;
 
   strmap = gtk_object_get_data(GTK_OBJECT(window), "pixmap");    /*pixmap is created in main and set to window*/
   image = gdk_imlib_create_image_from_drawable(strmap, NULL, 0, 0, 400, 200);
   gdk_imlib_save_image(image, "test.xpm", NULL);
   /* I have tried gdk_imlib_save_image_to_*(), but it didn't work either. */
}


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