Re: wrapping a pixmap



On Fri, 23 Mar 2001, guigtk wrote:

In my application done with Glade, the main window reads a big pixmap
from /pixmaps directory. ¿How can I introduce it into the c source-code
and compile all together? (¿or another way to do it?)
If I copy another same-name pixmap file in /pixmaps directory, the
application reads the new one.
Thanks a million

Do you mean that you want the pixmap to be compiled into the executable?
If so, a .xpm pixmap file is in fact text with a large static char *
array containing the image.  So, you include the pixmap file, something like

#include "pixmaps/bigpixmap.xpm"

Then, find out what the char array is called, and instead of loading the
pixmap from a file, using gdk_pixmap_create_from_xpm(), you create the
pixmap from the character array, using something like

pixmap = gdk_pixmap_create_from_xpm_d(window, mask, transparent_colour,
                                      the_char_array);

Where window, mask and transparent_colour are whatever you were passing to
gdk_pixmap_create_from_xpm() for those arguments.

Hope this helps

Jonathan







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