Re: can you compile in an image?



stan huang wrote:

Hi, I am just wondering if you can compile in a xpm
image, because currently I can only display picture if
it is in my currenty directory with the function
gtk_create_from_xpm(....), any help or pointers would
be appreciated!

Supposing you have your XPM-files in a subdirectory called xpms loading them into memory could be done with these few lines:

#include "xpms/anicon.xpm"
...
GdkPixbuf *pixbuf;
pixbuf = gdk_pixbuf_new_from_xpm_data (anicon_xpm);

For further information have a look at this:
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-creating.html

  -Bernhard






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