GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 23, 2014 5:58 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to embeded an Image in file in to the application [XPM]
PostPosted: Mon Aug 20, 2007 9:51 pm 
Offline
Familiar Face

Joined: Mon Aug 20, 2007 8:52 pm
Posts: 8
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:
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.

Thanks
subaren


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 8:45 am 
Offline
Familiar Face

Joined: Mon Aug 20, 2007 8:52 pm
Posts: 8
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.

Code:
gdk_pixbuf_new_from_xpm_data ()


Thanks
subaren


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 4:54 pm 
Offline
Familiar Face

Joined: Mon Aug 20, 2007 8:52 pm
Posts: 8
Solved the problem!

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.
Image
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!

Here is the link
http://www.gtk.org/tutorial1.2/gtk_tut-9.html#ss9.6

Thanks
subaren


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group