Python Forum
Having trouble using photo for background
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having trouble using photo for background
#1
Just wondering what I am doing wrong. I have a photo named overlander_sports.jpg in the newb folder which is the name of the project. I can't seem to get it as a background.

from tkinter import *
import datetime
from tkinter import messagebox

root = Tk()
#Date and Time

C = Canvas(root, bg="blue", height=250, width=300)
filename = PhotoImage(file="C:\\Users\\blake\PycharmProjects\\newb\\overlander_sports.jpg")

background_label = Label(root, image=overlander_sports.jpg)
background_label.place(x=0, y=0, relwidth=1, relheight=1)

C.pack()
Reply


Messages In This Thread
Having trouble using photo for background - by blakefindlay - Jan-27-2021, 05:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  set button background with image of window background gray 3 14,500 Oct-18-2017, 08:22 AM
Last Post: gray

Forum Jump:

User Panel Messages

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