Python canvas.Canvas() Examples

The following are 2 code examples of canvas.Canvas(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module canvas , or try the search function .
Example #1
Source File: window.py    From rasterizer.py with Apache License 2.0 6 votes vote down vote up
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()) 
Example #2
Source File: classifier_grid.py    From ncappzoo with MIT License 5 votes vote down vote up
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.