python - 如何使用 Tkinter-canvas 画一条鱼?
问题描述
我正在尝试使用 tkinter 定义的 Canvas 类在碗中画一条鱼。我画了一个立方体,工作完成了 50%,但我需要帮助来画碗里的鱼。如何使用 Tkinter Canvas 画一条鱼?请帮帮我!
这就是我想要实现的
这是我的代码:
from tkinter import *
root = Tk()
root.title('graphics')
canv = Canvas(root, width = 800, height = 800, bg = "white", cursor = "pencil")
canv.create_line(150, 250, 450, 250, width = 2, fill = "black")
canv.create_line(150, 550, 450, 550, width = 2, fill = "black")
canv.create_line(150, 250, 150, 550, width = 2, fill = "black")
canv.create_line(450, 250, 450, 550, width = 2, fill = "black")
canv.create_line(300, 150, 600, 150, width = 2, fill = "black")
canv.create_line(300, 450, 600, 450, width = 2, fill = "black")
canv.create_line(300, 150, 300, 450, width = 2, fill = "black")
canv.create_line(600, 150, 600, 450, width = 2, fill = "black")
canv.create_line(150, 250, 300, 150, width = 2, fill = "black")
canv.create_line(450, 250, 600, 150, width = 2, fill = "black")
canv.create_line(150, 550, 300, 450, width = 2, fill = "black")
canv.create_line(450, 550, 600, 450, width = 2, fill = "black")
canv.create_line(150, 300, 300, 200, width = 2, fill = "black")
canv.create_line(450, 300, 600, 200, width = 2, fill = "black")
canv.create_line(150, 300, 450, 300, width = 2, fill = "black")
canv.create_line(300, 200, 600, 200, width = 2, fill = "black")
canv.pack()
root.mainloop()
解决方案
推荐阅读
- python - 我如何执行枚举?
- ubuntu - 在 ubuntu pycharm 中我找不到 anaconda 包
- sql - PostgreSQL - Distinct on 的随机顺序
- python - Pip install PyAudio 失败,错误代码为 1
- java - 将插入排序应用于对象数组
- android-studio - 如何在 Android Studio 中打开现有的 Flutter 项目
- reactjs - react-google-maps“'google'未定义”错误
- javascript - 为什么即使我没有明确使用 React,我也需要 import React 语句?
- apache-spark - 使用 PySpark 的 Librosa 特征提取方法
- python - 安装情节