Last active
May 9, 2019 20:31
-
-
Save tonyb486/1bf0c679dd257f317a4a829f769b105d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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