image_file.py 文件源码

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

项目:mountain_tapir 作者: tttppp 项目源码 文件源码
def makeImage(self, purpose, dimensions, canvas):
        """Make a :class:`PIL.Image` and put it in the supplied canvas.

        :param purpose: A string describing the purpose of the image. This is
            used for both logging and also when persisting the image so that TK
            doesn't garbage collect it.
        :param dimensions: An iterable pair - (width, height).
        :param canvas: The :class:`tkinter.Canvas` where the image will be
            displayed.
        """
        image = self.getImageObject(dimensions, purpose)
        if image is not None:
            photoImage = ImageTk.PhotoImage(image)
            self.images[purpose].append(photoImage)
            canvas.create_image(0, 0, image=photoImage, anchor="nw")
            canvas.config(scrollregion=canvas.bbox(TK.ALL))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号