Python Forum
[Tkinter] Problem loading an image from directory into a Canvas object
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Problem loading an image from directory into a Canvas object
#4
Quote:what is driving me mad is that I don't even get an error message
There is no error to report. You have to keep a copy of the image, otherwise it is garbage collected when the function, init in this case, exits, so does not show because it's gone. Make the photo variable an instance object.
Reply


Messages In This Thread
RE: Problem loading an image from directory into a Canvas object - by woooee - Sep-02-2018, 06:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how do i find the canvas location of an object? gr3yali3n 10 6,786 Feb-21-2024, 02:00 AM
Last Post: caylakling
  [Tkinter] canvas image problem DPaul 4 6,271 Nov-24-2021, 07:06 AM
Last Post: DPaul
  how to resize image in canvas tkinter samuelmv30 2 17,562 Feb-06-2021, 03:35 PM
Last Post: joe_momma
  Problem about image and button scotesse 5 2,885 Apr-27-2020, 10:09 AM
Last Post: scotesse
  [Tkinter] Display Selected Image from Directory and Resize it EchoLi 0 4,200 Oct-02-2019, 06:54 PM
Last Post: EchoLi
  [Tkinter] Resizing image inside Canvas (with Canvas' resize) Gupi 2 25,027 Jun-04-2019, 05:05 AM
Last Post: Gupi
  Canvas refreshing problem Faruk 2 2,435 Dec-04-2018, 08:52 AM
Last Post: Faruk
  'list' object has no attribute 'plot' problem BaartCM 2 18,138 Feb-03-2018, 09:20 PM
Last Post: BaartCM
  Problem with pygame not switching the mouse image Mondaythe1st 6 6,629 Jul-26-2017, 10:53 PM
Last Post: metulburr
  Drag and drop image object vijaysagi 1 16,775 Apr-06-2017, 09:36 AM
Last Post: wuf

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020