+ 2
How to display images in multiple canvas using tkinter library? [Solved]
Here is the code for it ,which displays only second image and i don't really understand why so and how can i make it display both . Any help is much appreciated! https://code.sololearn.com/cA7DKZRfVB55/?ref=app
3 Answers
+ 1
Greetings, Abhay . I've checked your code in editor.
Try to uncomment each of these codes, and you'll see how it works.
First one is rotating the image.
Second one is not rotating.
And most important is that you can't use same variable when you rotating the image.
"""
# This code for rotation of second image
Img2=img.rotate(45)
Img2=ImageTk.PhotoImage(Img2)
canvas2.create_image(0,0, anchor=tk.NW,image=Img2)
"""
"""
# This code for standard display of second image
canvas2.create_image(0,0, anchor=tk.NW,image=Img)
root.mainloop()
"""
0
Maksat Ramazanov thanks a lot :) ! works absolutely well now .
- 1
vishal kapur