NULL GdkPixbuf

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

 



Hi All,

I have written a small program (attached below) and am
facing a problem in it. I am trying to create a
GdkPixbuf out of a "png" file. But I am getting a NULL
value. This does not happen with "bmp" files. I am
working on Solaris 8. Has any one got any idea why
this might be happening? Am I missing some libraries?
It compiles and links w/o any warnings/errors but when
run the value is NULL (ppp = 0). I tried this on a
Linux machine with the same PNG and everything is
fine.


#include <gtk/gtk.h>
#include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <X11/Xlib.h>
int main( int   argc, char *argv[] )
{
        gtk_init (&argc, &argv);
        GtkWidget *w =
gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_move(GTK_WINDOW(w),400,400);
       
gtk_window_set_default_size(GTK_WINDOW(w),4,4);

        GdkPixbuf* ppp =
gdk_pixbuf_new_from_file("/space/pramod/1.png",NULL);
// any bmp file works fine here
        printf("PIXBUF : %p\n",ppp);
        GtkWidget *i = gtk_image_new_from_pixbuf(ppp);
        gtk_container_add(GTK_CONTAINER(w),i);

        gtk_widget_show(i);
        gtk_widget_show(w);

        gtk_main();
        return 0;
}

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux