请问在窗口中画线用什么函数?
用Tk创建一个窗口,然后在窗口中画线用什么函数可以现实?root = tk.Tk()
can = tk.Canvas(root, width=200, height=100, background='white')
can.pack()
line1 = can.create_line(0, 50, 200, 50, fill='black')# 实线
line2 = can.create_line(100, 0, 100, 100, fill='grey', dash=(4, 4))# 虚线
rect1 = can.create_rectangle(25, 25, 175, 75, fill='yellow')# 矩形
rect2 = can.create_rectangle(20, 20, 180, 80, dash=(4, 4))# 虚线矩形
oval1 = can.create_oval(20, 20, 180, 80, dash=(4, 4))# 虚线椭圆
页:
[1]