Re: Not work "gdk_imlib_copy_image"! why?



haven't touched imlib for a while, but one thing is you must call gdk_imlib_render() before gdk_imlib_load_image() I think

On Sun, Apr 01, 2001 at 10:37:40PM +0900, À¯´ë»ó wrote:
> /*
>  *     Usage : test <filename> 
>  *
>  */
> 
> 
> 
> #include <gdk_imlib.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();
> 
> /* 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");
>    }
>   
> 
>   }
> 
> 




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