Skip to content

Instantly share code, notes, and snippets.

@tonyb486
Last active May 9, 2019 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyb486/1bf0c679dd257f317a4a829f769b105d to your computer and use it in GitHub Desktop.
Save tonyb486/1bf0c679dd257f317a4a829f769b105d to your computer and use it in GitHub Desktop.
import tkinter
from PIL import ImageTk, Image
window = tkinter.Tk()
window.title("Image")
window.configure(background='grey')
window.attributes("-fullscreen", True)
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()
img = Image.open("image.jpg");
img = img.resize((int(screen_width/3), int(screen_height/2)), Image.ANTIALIAS)
tkImg = ImageTk.PhotoImage(img)
panel = tkinter.Label(window, image = tkImg)
panel.pack(side = "left", fill = "both", expand = "yes")
panel = tkinter.Label(window, image = tkImg)
panel.pack(side = "right", fill = "both", expand = "yes")
window.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment