Python Forum
My Background Image Is Not Appearing (Python Tkinter)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My Background Image Is Not Appearing (Python Tkinter)
#2
If you use png you can do it that way

from tkinter import Canvas, PhotoImage, Tk

root = Tk()
  
root.geometry("1230x750")
bg = PhotoImage(file = "school.png")
  
canvas1 = Canvas( root)
canvas1.pack(fill = "both", expand = True)

canvas1.create_image( 0, 0, image = bg, 
                     anchor = "nw")

root.mainloop()
Reply


Messages In This Thread
RE: My Background Image Is Not Appearing (Python Tkinter) - by Axel_Erfurt - Mar-14-2023, 02:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinter: An image and label are not appearing. emont 7 1,099 Mar-21-2024, 03:00 PM
Last Post: deanhystad
  simple tkinter question function call not opening image gr3yali3n 5 3,709 Aug-02-2022, 09:13 PM
Last Post: woooee
  [Tkinter] Tkinter don't change the image DQT 2 1,782 Jul-22-2022, 10:26 AM
Last Post: menator01
  [Tkinter] Background inactivity timer when tkinter window is not active DBox 4 3,095 Apr-16-2022, 04:04 PM
Last Post: DBox
  [Tkinter] Not able to get image as background in a Toplevel window finndude 4 4,089 Jan-07-2022, 10:10 PM
Last Post: finndude
  How to redraw an existing image to a different image TkInter zazas321 6 6,152 Jul-08-2021, 07:44 PM
Last Post: deanhystad
  tkinter showing image in button rwahdan 3 5,801 Jun-16-2021, 06:08 AM
Last Post: Yoriz
  tkinter button image Nick_tkinter 4 4,213 Mar-04-2021, 11:33 PM
Last Post: deanhystad
  how to resize image in canvas tkinter samuelmv30 2 18,117 Feb-06-2021, 03:35 PM
Last Post: joe_momma
Question [Tkinter] Can I set background color for each item in tkinter Combobox? water 1 5,255 Dec-10-2020, 07:48 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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