/*
*
Usage : test <filename>
*
*/
#include <gdk_imlib.h>
#include <gdk/gdk.h>
#include <gdk/gdk.h>
int main(int argc, char **argv)
{
{
/* Be nice and tell the user if they don't, to provide a file
as an arg */
if (argc<=1)
{
printf("Usage:\n %s image_file\n",argv[0]);
exit(1);
}
/* Inititalise GDK */
gdk_init(&argc,&argv);
/* Immediately after initialising GDK, Initialise Imlib */
gdk_imlib_init();
if (argc<=1)
{
printf("Usage:\n %s image_file\n",argv[0]);
exit(1);
}
/* Inititalise GDK */
gdk_init(&argc,&argv);
/* Immediately after initialising GDK, Initialise Imlib */
gdk_imlib_init();
/* Get gdk to use imlib's visual and colormap
*/
gtk_widget_push_visual(gdk_imlib_get_visual());
gtk_widget_push_colormap(gdk_imlib_get_colormap());
/* Load the image specified as the first argument */
im=gdk_imlib_load_image(argv[1]);
/* Copy to a pixmap */
testpixmap=gdk_imlib_copy_image(im);
if(testpixmap==0x00)/******************** why does it return NULL? ***********************************/
{
g_print("any error is occured - testpixmap==0x00\r\n");
}
}
gtk_widget_push_visual(gdk_imlib_get_visual());
gtk_widget_push_colormap(gdk_imlib_get_colormap());
/* Load the image specified as the first argument */
im=gdk_imlib_load_image(argv[1]);
/* Copy to a pixmap */
testpixmap=gdk_imlib_copy_image(im);
if(testpixmap==0x00)/******************** why does it return NULL? ***********************************/
{
g_print("any error is occured - testpixmap==0x00\r\n");
}
}
