def savePreview(self):
print("Generating preview image...")
x1 = self.winfo_rootx()+self.canvas.winfo_x()
y1 = self.winfo_rooty()+self.canvas.winfo_y()
x2 = x1+self.canvas.winfo_width()
y2 = y1+self.canvas.winfo_height()
coords = [x1, y1, x2, y2]
if os.path.isfile("preview.png") and not self.app_config['overwrite'] in ['always', 'preview']:
if not messagebox.askyesno("Warning", "Preview image already exists, do you want to overwrite?", icon='warning'):
return
self.attributes("-topmost", 1)
self.attributes("-topmost", 0)
self.canvas.delete('toolbar')
self.canvas.update_idletasks()
ImageGrab.grab().crop((x1,y1,x2,y2)).save("preview.png")
#self.v['canvas_image'].save("preview.png")
self.updateCanvas()
fbi_theme_preview.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录