Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How To Display A Background Image With Tkinter

Import tkinter
from tkinter import *
from PIL import Image, ImageTk

root = Tk()

# Create a photoimage object of the image in the path
image1 = Image.open("<path/image_name>")
test = ImageTk.PhotoImage(image1)

label1 = tkinter.Label(image=test)
label1.image = test

# Position image
label1.place(x=<x_coordinate>, y=<y_coordinate>)
root.mainloop()
Source by www.activestate.com #
 
PREVIOUS NEXT
Tagged: #How #To #Display #A #Background #Image #With #Tkinter
ADD COMMENT
Topic
Name
6+5 =