diff --git a/.idea/Filteristic.iml b/.idea/Filteristic.iml index 8aeb520..cd50985 100644 --- a/.idea/Filteristic.iml +++ b/.idea/Filteristic.iml @@ -6,6 +6,7 @@ + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 8d93904..d56657a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/Tkinter/123.png b/Tkinter/123.png new file mode 100644 index 0000000..80fb972 Binary files /dev/null and b/Tkinter/123.png differ diff --git a/Tkinter/261531137_719791896078103_2600042766894789699_n.jpg b/Tkinter/261531137_719791896078103_2600042766894789699_n.jpg new file mode 100644 index 0000000..7ae2535 Binary files /dev/null and b/Tkinter/261531137_719791896078103_2600042766894789699_n.jpg differ diff --git a/Tkinter/GUI.py b/Tkinter/GUI.py index e599d01..0d5e101 100644 --- a/Tkinter/GUI.py +++ b/Tkinter/GUI.py @@ -7,40 +7,42 @@ from PIL import Image, ImageTk import time import cv2 -from snapshot import App, videoCapture +# from snapshot import App, videoCapture root = tk.Tk() images = [] ######### import Window ########## -def importWindow(): - def browse(newWindow): - filename = filedialog.askopenfilename(initialdir="/home/yousef/Pictures", title="select File", - filetypes=(("executables", "*.jpg"), ("all files", "*.*"))) - images.append(filename) - canv = Canvas(newWindow, width=150, height=150, bg='white') - canv.grid(row=2, column=3) +def importWindow(): + newWindow = Toplevel(root) + newWindow.geometry("1000x1000") + def browse(): - img = ImageTk.PhotoImage(Image.open('Cat03.jpg')) - canv.create_image(20, 20, anchor=NW, image=img) + filename = filedialog.askopenfilename(initialdir="/home/yousef/Pictures", title="select File", + filetypes = (("jpeg files","*.jpg"),("all files","*.*"),('png files', '*.png'))) + images.append(filename) + canvas = Canvas(newWindow) + canvas.config(width=1000, height=500) + canvas.grid(row=1 , column=0,columnspan=3) + print(filename) + img = ImageTk.PhotoImage(Image.open(images[0])) + canvas.create_image(0, 0, anchor="nw", image=img) + mainloop() - newWindow = Toplevel(root) root.withdraw() newWindow.title("New Window") newWindow.geometry("700x700") - Label(newWindow, - text="This is a new window").grid() - backButton = tk.Button(newWindow, text="Browse", padx=90, pady=10, fg="white", bg="#2596be", font=('arial', 15),command=lambda: browse(newWindow)) - backButton.grid() + backButton = tk.Button(newWindow, text="Browse", padx=90, pady=10, fg="white", bg="#2596be", font=('arial', 15),command=browse) + backButton.grid(row=0 , column=0) ######## Back to previous window ######## def on_closing(): newWindow.destroy() root.deiconify() backButton = tk.Button(newWindow, text="Previous Page", padx=90, pady=10, fg="white", bg="#2596be", font=('arial', 15), command=on_closing) - backButton.grid() + backButton.grid(row=0 , column=2) newWindow.protocol("WM_DELETE_WINDOW", on_closing) @@ -65,7 +67,7 @@ def openCamera(): canv.grid(row=2, column=3) - img = ImageTk.PhotoImage(Image.open('Cat03.jpg')) + img = ImageTk.PhotoImage(Image.open('123.png')) canv.create_image(20, 20, anchor=NW, image=img) diff --git a/Tkinter/__pycache__/snapshot.cpython-39.pyc b/Tkinter/__pycache__/snapshot.cpython-39.pyc new file mode 100644 index 0000000..42d1e4e Binary files /dev/null and b/Tkinter/__pycache__/snapshot.cpython-39.pyc differ diff --git a/Tkinter/snapshot.py b/Tkinter/snapshot.py index 4f9658e..3b93e2b 100644 --- a/Tkinter/snapshot.py +++ b/Tkinter/snapshot.py @@ -6,7 +6,7 @@ -from PyQt5.QtMultimedia import * +# from PyQt5.QtMultimedia import * from PyQt5.QtCore import QUrl class App: diff --git a/__pycache__/main.cpython-39.pyc b/__pycache__/main.cpython-39.pyc new file mode 100644 index 0000000..1a84fe7 Binary files /dev/null and b/__pycache__/main.cpython-39.pyc differ diff --git a/pyproject.toml b/pyproject.toml index 44cd5b5..c32c3e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "" authors = ["hayaa1234 "] [tool.poetry.dependencies] -python = "^3.9" +python = "~3.9" [tool.poetry.dev-dependencies]