2

I want to resize PhotoImage at load stage. As you know, .zoom and .subsample cannot work with floating variables, only integers. Now I resize it with wrong way:

i1=PhotoImage(file="res\\1h.gif").zoom(new_size).subsample(old_size)

It works with small pictures but now I tried medium picture, and got error:

self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)

_tkinter.TclError: not enough free memory for image buffer

Community
  • 1
  • 1
D7ILeucoH
  • 97
  • 9
  • maybe use `PIL` to resize it and convert to `tkinter.PhotoImage` using `PIL.ImageTk.PhotoImage` – furas Dec 14 '19 at 19:20

1 Answers1

0

Heyy, if u want resize an PhotoImage, u can use 2 methods :

  • .zoom(number) : return bigger image >> with {number} times bigger
  • or .subsample(number) : return smaller image >> with {number} times smaller
Luzog78
  • 16