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>")
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()))
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>")
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()))
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()))
def setimage(self, image): self.config(bg="") # don't update the background self.dib = Dib(image) self.dib.expose(HWND(self.winfo_id()))