GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to embeded an Image in file in to the application [XPM]

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
subaren
Familiar Face


Joined: 20 Aug 2007
Posts: 8

PostPosted: Mon Aug 20, 2007 9:51 pm    Post subject: How to embeded an Image in file in to the application [XPM] Reply with quote

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.

Thanks
subaren
Back to top
subaren
Familiar Face


Joined: 20 Aug 2007
Posts: 8

PostPosted: Tue Aug 21, 2007 8:45 am    Post subject: Reply with quote

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: (Plaintext)
1
gdk_pixbuf_new_from_xpm_data ()


Thanks
subaren
Back to top
subaren
Familiar Face


Joined: 20 Aug 2007
Posts: 8

PostPosted: Tue Aug 21, 2007 4:54 pm    Post subject: Reply with quote

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.

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP