本文整理汇总了Python中canvas.Canvas方法的典型用法代码示例。如果您正苦于以下问题:Python canvas.Canvas方法的具体用法?Python canvas.Canvas怎么用?Python canvas.Canvas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类canvas
的用法示例。
在下文中一共展示了canvas.Canvas方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import canvas [as 别名]
# 或者: from canvas import Canvas [as 别名]
def __init__(self, pixels, width, height):
self.pixels = pixels
self.width = width
self.height = height
self.canvas = Canvas(width, height, pixels)
# setup key handlers
key_esc = 27
self.handlers = {
key_esc: self.exit
}
self.v1 = Vertex(Vector(0, 0), Color.cyan())
self.v2 = Vertex(Vector(300, 100), Color.red())
self.v3 = Vertex(Vector(200, 300), Color.green())
示例2: timer_thread_proc
# 需要导入模块: import canvas [as 别名]
# 或者: from canvas import Canvas [as 别名]
def timer_thread_proc(canvas:canvas.Canvas):
start_time = time.time()
while not quit_flag:
time.sleep(1.0)
canvas.show_timer(time.time() - start_time)
# main entry point for program. we'll call main() to do what needs to be done.