-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwindows_test.py
45 lines (40 loc) · 1.24 KB
/
windows_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import tkinter
from PIL import ImageTk, Image
import os
import cv2
import base64
# class FullScreenApp(object):
# def __init__(self, master, **kwargs):
# self.master = master
# pad = 3
# self._geom = '200x200+0+0'
# master.geometry("{0}x{1}+0+0".format(
# master.winfo_screenwidth() - pad, master.winfo_screenheight() - pad))
# master.bind('<Escape>', self.toggle_geom)
#
# def toggle_geom(self, event):
# geom = self.master.winfo_geometry()
# print(geom, self._geom)
# self.master.geometry(self._geom)
# self._geom = geom
#
#
#
#
# root = tkinter.Tk()
# app = FullScreenApp(root)
# root.mainloop()
if __name__ == "__main__":
root = tkinter.Tk()
raw_image = cv2.imread("test.png")
# next_image = base64.encodebytes(raw_image)
image = tkinter.PhotoImage(raw_image)
label = tkinter.Label(image)
label.pack()
# window_label = tkinter.Label(root, text="Hello, world!")
# root.overrideredirect(True)
# root.geometry("{0}x{1}+0+0".format(root.winfo_screenwidth(), root.winfo_screenheight()))
# root.focus_set() # <-- move focus to this widget
# root.bind("<Escape>", lambda e: root.quit())
# window_label.pack()
root.mainloop()