def save_screenshot(window, output):
width, height = window.get_size()
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height)
screenshot = pixbuf.get_from_drawable(window.window, window.get_colormap(), 0, 0, 0, 0, width, height)
screenshot.save(output, 'png')
gtk.main_quit()
评论列表
文章目录