fbi_theme_preview_v1.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:FBIThemePreviewer 作者: jurassicplayer 项目源码 文件源码
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.updateCanvas()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号