def get_widget_screenshot(widget):
window = widget.get_window()
if not window: return None
allocation = widget.get_allocation()
pixbuf = Gdk.pixbuf_get_from_window(
window,
allocation.x,
allocation.y,
allocation.width,
allocation.height
)
if not pixbuf:
return None
else:
return pixbuf
评论列表
文章目录