-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path166.py
More file actions
35 lines (22 loc) · 763 Bytes
/
166.py
File metadata and controls
35 lines (22 loc) · 763 Bytes
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
from tkinter import *
from PIL import ImageTk, Image
root= Tk()
root.title("Working On Canvas Using Functions")
root.geometry("600x600")
color_label=Label(root, text="Enter a Color :")
color_label.place(relx=0.6,rely=0.9, anchor= CENTER)
input_box = Entry(root)
input_box.insert(0,"black")
input_box.place(relx=0.8,rely=0.9, anchor= CENTER)
canvas= Canvas(root, height=510,width=590,bg="white",highlightbackground="lightgray")
canvas.pack()
img=ImageTk.PhotoImage(Image.open("start_point1.png"))
my_image=canvas.create_image(75,50,image=img)
direction= ""
oldx= 50
oldy= 50
newx= 50
newy= 50
def draw(direction, oldx, oldy, newx, newy):
fill_color = input_box.get()
root.mainloop()