#! /usr/bin/env python # -*- coding: utf8 -*- import gtk # Puede ser png o jpeg (lowercase) formato = "jpeg" # Solo para jpg calidad = 40 w = gtk.gdk.screen_width() h = gtk.gdk.screen_height() screenshot = gtk.gdk.Pixbuf.get_from_drawable( gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, w, h), gtk.gdk.get_default_root_window(), gtk.gdk.colormap_get_system(), 0, 0, 0, 0, w, h) shotFile = "shot." +formato # Save the screnshot, checking before if to set JPEG quality if formato == 'jpeg': screenshot.save(shotFile, formato, {"quality":str(calidad)}) else: screenshot.save(shotFile, formato) # Save the screnshot, checking before if to set JPEG quality if formato == 'jpeg': screenshot.save(shotFile, formato, {"quality":str(calidad)}) else: screenshot.save(shotFile, formato)