GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed May 22, 2013 11:09 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: store gtk widget as a image to a file ?
PostPosted: Mon Mar 21, 2011 8:01 am 
Offline

Joined: Mon Mar 21, 2011 5:47 am
Posts: 1
Is there any way to store gtk widget as a image to a file on disk?

thanks in advance...


Top
 Profile  
 
 Post subject: Re: store gtk widget as a image to a file ?
PostPosted: Sat Apr 02, 2011 7:49 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 324
Location: Sydney, Australia
Depends on the widget:
For generic widgets there is gtk_widget_get_snapshot (http://library.gnome.org/devel/gtk/stab ... t-snapshot) which outputs to a gdkpixmap
However if its a widget you've custom made with cairo you can draw it to various image formats, thus both vector and pixel based images are possible.
Gtk3 is moving away from gdkpixmaps so the cairo option is preferable. I think it may be possible to also use in the generic case by getting the widget into the surface to be used by a cairo context.


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

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 5 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group