Exemplo n.º 1
0
def test_copy_back_to_fore(output_dir):

    mc = MapCanvas((400, 300), preset_colors='web')

    mc.background_color = 'white'
    mc.clear_background()
    mc.clear_foreground()

    mc.draw_polyline(((-30, 30),
                      (30, 30),
                      (30, -20),
                      (-30, -20)),
                     line_color='red',
                     line_width=5,
                     background=True)

    mc.copy_back_to_fore()
    mc.draw_polyline(((-20, 20),
                      (20, 20),
                      (20, -10),
                      (-20, -10)),
                     line_color='blue',
                     line_width=5,
                     background=False)

    mc.save_foreground(os.path.join(output_dir, "copy_back_to_fore.png"))
Exemplo n.º 2
0
def test_foreground_polyline(output_dir):
    """
    test drawing polygons to the background
    """
    mc = MapCanvas((400, 300), preset_colors='web')

    mc.background_color = 'transparent'
    mc.clear_background()

    mc.draw_polyline(((-30, 30), (30, 30), (30, -20), (-30, -20)),
                     line_color='red',
                     line_width=5,
                     background=False)

    mc.save_foreground(os.path.join(output_dir, "foreground_polyline.png"))
Exemplo n.º 3
0
def test_foreground_poly(output_dir):
    """
    test drawing polygons to the foreground
    """
    mc = MapCanvas((400, 300), preset_colors='web')

    mc.background_color = 'transparent'
    mc.clear_background()

    mc.draw_polygon(((-30, 30), (30, 30), (30, -20), (-30, -20)),
                    fill_color='white',
                    line_color='black',
                    background=False)

    mc.save_foreground(os.path.join(output_dir, "foreground.png"))
Exemplo n.º 4
0
def test_foreground_polyline(output_dir):
    """
    test drawing polygons to the background
    """
    mc = MapCanvas((400, 300), preset_colors='web')

    mc.background_color = 'transparent'
    mc.clear_background()

    mc.draw_polyline(((-30, 30),
                      (30, 30),
                      (30, -20),
                      (-30, -20)),
                     line_color='red',
                     line_width=5,
                     background=False)

    mc.save_foreground(os.path.join(output_dir, "foreground_polyline.png"))
Exemplo n.º 5
0
def test_background_poly(output_dir):
    """
    test drawing polygons to the background
    """
    mc = MapCanvas((400, 300), preset_colors='web')

    mc.background_color = 'transparent'
    mc.clear_background()

    mc.draw_polygon(((-30, 30),
                     (30, 30),
                     (30, -20),
                     (-30, -20)),
                    fill_color='blue',
                    line_color='black',
                    background=True)

    mc.save_background(os.path.join(output_dir, "background.png"))
Exemplo n.º 6
0
def test_copy_back_to_fore(output_dir):

    mc = MapCanvas((400, 300), preset_colors='web')

    mc.background_color = 'white'
    mc.clear_background()
    mc.clear_foreground()

    mc.draw_polyline(((-30, 30), (30, 30), (30, -20), (-30, -20)),
                     line_color='red',
                     line_width=5,
                     background=True)

    mc.copy_back_to_fore()
    mc.draw_polyline(((-20, 20), (20, 20), (20, -10), (-20, -10)),
                     line_color='blue',
                     line_width=5,
                     background=False)

    mc.save_foreground(os.path.join(output_dir, "copy_back_to_fore.png"))