0

So I'm trying to understand how to add background images to my projects but I seemingly do not know why it does not work?

  Interface_Win = tk.Toplevel(LoginWindow)
    Interface_Win.title("IBDoc program")
    Interface_Win.geometry("800x600")
    bg2 = PhotoImage(file="K:/Video game projects and Unity/PythonApplication1/PythonApplication1/IBDocBG.png")
    labeliukas = Label(Interface_Win,image=bg2)
    labeliukas.pack()

This was regular attempt that I tried and it did not pop up

I also tried doing this with PIL but I also had no good result.

    Interface_Win = tk.Toplevel(LoginWindow)
    Interface_Win.title("IBDoc program")
    Interface_Win.geometry("800x600")
    image = Image.open("K:/Video game projects and Unity/PythonApplication1/PythonApplication1/IBDocBG.png")
    image = image.resize((800, 600)) 
    tk_image = ImageTk.PhotoImage(image)
    bg2_label = Label(Interface_Win, image=tk_image)
    bg2_label.place(x=0, y=0, relwidth=1, relheight=1)

No results as well so I'm pretty sure I got something wrong or my python is tweaking

Slazicity
  • 1
  • 1

0 Answers0