image_viewer.py 文件源码

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

项目:Quiver 作者: DeflatedPickle 项目源码 文件源码
def load_image(self, image=""):
        self.widget_canvas_image.delete("all")

        self.image_open = Image.open(image, "r")
        self.image_photo = ImageTk.PhotoImage(self.image_open)

        self.original_width = self.image_photo.width()
        self.original_height = self.image_photo.height()

        self.widget_canvas_image.configure(scrollregion=(0, 0, self.image_photo.width(), self.image_photo.height()))
        self.widget_canvas_image.configure(width=self.image_photo.width(), height=self.image_photo.height())
        self.drawn_image = self.widget_canvas_image.create_image(0, 0, anchor="nw", image=self.image_photo,
                                                                 tags="image")
        self.title("{} - {}".format(self.title(), "".join(os.path.splitext(image))))

        self.check_tile_buttons()
        self.draw_background()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号