samedi 11 avril 2015

How to control the size of a picture using tkinter?

I want to control the size of the picture in m_image (say, I want it to be 420x380).

How do I do that?



import tkinter as tk

m_gui = tk.Tk()
m_image = tk.PhotoImage(file = 'pic.gif')
m_canvas = tk.Canvas(m_gui)
m_canvas.create_image(0, 0, image = m_image)
m_canvas.pack()

m_gui.mainloop()


It would be great if you could also give an explanation about the first two parameters of the create_image func.


Thank you


Aucun commentaire:

Enregistrer un commentaire