diff options
author | Daniel Francis <santiago.danielfrancis@gmail.com> | 2012-02-14 11:26:00 (GMT) |
---|---|---|
committer | Daniel Francis <santiago.danielfrancis@gmail.com> | 2012-02-14 11:26:00 (GMT) |
commit | 6df236b61aa9888a215741cf36fbf394611af8c0 (patch) | |
tree | d7ffb4e60ebdc5eef9b0e03ed20a2707e8b5f806 | |
parent | 55900703dd24650cf4c04263559a0a629f351270 (diff) |
Save as .png function
-rwxr-xr-x | lybniz.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) |