Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from PIL import Image, ImageTk
- import time
- t = Tk()
- t.resizable(False, False)
- t.attributes('-fullscreen', True)
- width = t.winfo_screenwidth()
- height = t.winfo_screenheight()
- padding = 50
- c = Canvas(t, bd=-2, width=width, height=height, bg="#434343")
- c.pack()
- def render():
- c.delete("all")
- c.create_image(width / 2, height / 2, image=ImageTk.PhotoImage(Image.open("image.jpg")))
- c.update()
- def stop(event):
- running = False
- t.destroy()
- t.bind("<Escape>", stop)
- running = True
- try:
- while running:
- render()
- t.update()
- except:
- Exception
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement