Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tautils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tautils.py')
-rw-r--r--tautils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tautils.py b/tautils.py
index 3cad9c8..0471421 100644
--- a/tautils.py
+++ b/tautils.py
@@ -131,3 +131,11 @@ def do_dialog(dialog, suffix, load_save_folder):
dialog.destroy()
return result, load_save_folder
+def save_picture(canvas, fname):
+ pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, canvas.width, \
+ canvas.height)
+ pixbuf.get_from_drawable(canvas.canvas.images[0],
+ canvas.canvas.images[0].get_colormap(),
+ 0, 0, 0, 0, canvas.width, canvas.height)
+ pixbuf.save(fname, 'png')
+