예제 #1
0
class ImageView(Frame):
    def __init__(self, master, **options):
        Frame.__init__(self, master, **options)
        self.pack()
        self.dib = None

    def setimage(self, image):
        self.config(bg="")  # don't update the background
        self.dib = Dib(image)
        self.dib.expose(HWND(self.winfo_id()))
예제 #2
0
class ImageView(Frame):

    def __init__(self, master, **options):
        Frame.__init__(self, master, **options)
        self.pack()
        self.dib = None

    def setimage(self, image):
        self.config(bg="") # don't update the background
        self.dib = Dib(image)
        self.dib.expose(HWND(self.winfo_id()))
예제 #3
0
    class ImageView(Frame):

        def __init__(self, master, **options):
            Frame.__init__(self, master, **options)
            self.dib = None
            self.bind("<Expose>", self._expose)

        def setimage(self, image):
            self.config(bg="") # don't update the background
            self.dib = Dib(image.convert('RGB'))
            self.master.configure(width=self.dib.size[0],height=self.dib.size[1])
            self.configure(width=self.dib.size[0],height=self.dib.size[1])
            self.pack()
            self.event_generate("<Expose>")

        def _expose(self, event):
            if self.dib:
                self.dib.expose(HWND(self.winfo_id()))
예제 #4
0
    class ImageView(Frame):
        def __init__(self, master, **options):
            Frame.__init__(self, master, **options)
            self.dib = None
            self.bind("<Expose>", self._expose)

        def setimage(self, image):
            self.config(bg="")  # don't update the background
            self.dib = Dib(image.convert('RGB'))
            self.master.configure(width=self.dib.size[0],
                                  height=self.dib.size[1])
            self.configure(width=self.dib.size[0], height=self.dib.size[1])
            self.pack()
            self.event_generate("<Expose>")

        def _expose(self, event):
            if self.dib:
                self.dib.expose(HWND(self.winfo_id()))