检查create_rectangle函数的参数是否设置合理: 确保传递给create_rectangle的坐标值是合理的,且这些坐标值应该在Canvas的可视范围内。如果坐标值超出了Canvas的范围,矩形可能不会被显示。 确保Tkinter画布(Canvas)已经被正确初始化和配置: 在调用create_rectangle之前,必须确保Canvas已经被创建并添加到Tkinter窗口中。例如...
问Tkinter create_rectangle性能EN我使用create_rectangle在无限循环中绘制和更新画布上的WxH网格。我注意到...
Sucherly12 声望
While building a Python application with a graphical user interface, I often need to display data clean and organized. The tables are perfect for this. However, when I started with Tkinter, I wasn’t sure how to create tables. After some research and experimentation, I discovered that the Tr...
我正在尝试使用 PNG 图像在 python 中创建一个带有 tkinter 的按钮。图像的透明角是否透明取决于我使用的小部件。它似乎canvas.create_image是唯一保留透明度的小部件。 首先,我使用在画布上添加图像create_image(0,0, image=button)并且效果很好 - 圆角是透明的。 但是当我尝试将它实现为使用Button()和create_wind...
from tkinter import * root = Tk() root.title('作者CSDN :1bit 帐号:A757291228') canvas = Canvas(root,background='#D4D4D4',width=830,height=830)#初始化 canvas canvas.pack(fill=BOTH,expand=YES) coord = 200, 200, 400, 400 canvas.create_rectangle(coord) ...
百度试题 结果1 题目tkinter中Canvas组件的函数()是用于绘制椭圆形的。 A. create_rectangle B. create_arc C. create_oval D. create_line 相关知识点: 试题来源: 解析 C 反馈 收藏
self.create_rectangle( 7, 27, 690, 690, outline='#d9d8d7' ) def finish_game(self): self.delete(ALL) self.create_text( self.winfo_width() / 2, self.winfo_height() / 2, text=f'Game over! You have scored {self.score}!', ...
from tkinterimport*root=Tk()root.title('作者CSDN :1bit 帐号:A757291228')canvas=Canvas(root,background='#D4D4D4',width=830,height=830)#初始化 canvas canvas.pack(fill=BOTH,expand=YES)coord=200,200,400,400canvas.create_rectangle(coord)arc=canvas.create_arc(coord,start=10) ...
This leaves parameter 2d_height - ((1 + n) * step_size) + bar_spacerwhich gives thetop yposition of the rectangle to draw. This is the only calculation that changes as we draw the blocks. A key fact to remember here is thatycoordinates inQPainterstart at the top and increase down ...