def __init__(self):
self.image1 = Image.open(mGui.btn2text.get()[9:] + '-scroll.png')
w1, h1 = self.image1.size
self.imagefull = Image.new("RGB", (w1 * 2, h1), "black")
self.imagefull.paste(self.image1, (0, 0))
self.imagefull.paste(self.image1, (w1, 0))
self.photo1 = ImageTk.PhotoImage(self.imagefull)
width1 = self.photo1.width()
height1 = self.photo1.height()
novi1 = Toplevel()
self.canvas1 = Canvas(novi1, width=1980, height=34)
self.canvas1.pack(expand=1, fill=BOTH) # <--- Make your canvas expandable.
x = (width1)/2.0
y = (height1)/2.0
self.item = self.canvas1.create_image(x, y, image=self.photo1) # <--- Save the return value of the create_* method.
self.x00, self.y00 = self.canvas1.coords(self.item)
self.canvas1.bind('<Button-1>', self.next_image)
评论列表
文章目录