Skip to content
Merged

GUI #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/Filteristic.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Tkinter/123.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 19 additions & 17 deletions Tkinter/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)


Expand Down
Binary file added Tkinter/__pycache__/snapshot.cpython-39.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion Tkinter/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@



from PyQt5.QtMultimedia import *
# from PyQt5.QtMultimedia import *
from PyQt5.QtCore import QUrl

class App:
Expand Down
Binary file added __pycache__/main.cpython-39.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = ""
authors = ["hayaa1234 <hayalawansah@gmail.com>"]

[tool.poetry.dependencies]
python = "^3.9"
python = "~3.9"

[tool.poetry.dev-dependencies]

Expand Down