Posted: Mon Aug 20, 2007 9:51 pm Post subject: How to embeded an Image in file in to the application [XPM]
Embedding an image in to the application
How to embedded an image in to the application from .XPM file. So that the original image file no longer needed to be included along with the binary distribution.
For example this code required always the image file has to be presented in the path where it is mentioned.
Code: (Plaintext)
1
image = gtk_image_new_from_file ("test.xpm");
This forum seem to be very interesting and helpful. I am sure many will have benefited by this site.
I found something like this. I dont know it is going to be the right one to do the work until I test them. Please post any rough code that you feel much beter. That will be more helpful.
Finally I found the information and sample code from the GTK+ Ver 1.x tutorial site. Doesn't mater the version in here when you compile using GTK+ 2.x as long as it works. Meny ways GTK+ 2.x version sharing some compatibilities with GTK+ 1.x.
Look at the screen shot here which displaying a wheelbarrow image on the desktop from an embedded XPM file. Not only embedded but a transparent beautifully shaped window!