Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlybniz.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lybniz.py b/lybniz.py
index b37cff8..14292eb 100755
--- a/lybniz.py
+++ b/lybniz.py
@@ -318,6 +318,12 @@ class GraphClass:
return (x - self.x_min) * self.canvas_width / (self.x_max - self.x_min)
class LybnizActivity(activity.Activity):
+ def write_file(self, file_path):
+ x, y, w, h = self.graph.drawing_area.get_allocation()
+ pix_buffer = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, w, h)
+ pix_buffer.get_from_drawable(self.graph.pix_map, self.graph.pix_map.get_colormap(), 0, 0, 0, 0, w, h)
+ pix_buffer.save(file_path, "png")
+
def parameter_entries_repopulate(self):
# set text in entries for parameters
self.y1_entry.set_text(y1)