'How to change the size of the icon in a Tkinter application
I have an image which size is 304x105 (more wide than tall) but when I add it as a icon in my Tkinter application is shrinks and cannot be seen properly:
This is what I have written so far (related with the icon)
def set_icon(self):
img = tk.Image("photo", file="icon.gif")
self.tk.call('wm', 'iconphoto', self._w, img)
Solution 1:[1]
Well I also faced this kind of problem I think you should try: Pls upvote new user
from PIL import Image,ImageTk
resized_image= img.resize((300,205), Image.ANTIALIAS)
new_image= ImageTk.PhotoImage(resized_image)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Aninet |