Пример #1
0
def img_log_rects(img, rcts, text):
    '''
    1. draw rectangles on image
    2. save image
    '''
    if not log.isEnabledFor(DEBUG):
        return
    img2 = draw_indexed_rect_list(img, rcts)
    img_log(img2, text + '_with_rects')
Пример #2
0
def main():
    with SmartDisplay(size=(640, 480), visible=0) as disp:
        with EasyProcess('gnumeric'):
#            time.sleep(2)
            img = disp.waitgrab(timeout=60)
            rectangles = active_rectangles()
            print( rectangles )

    img = draw_indexed_rect_list(img, rectangles)
    img = autocrop(img)

    # display results
    img.show()
Пример #3
0
def main():
    with Display():
        with EasyProcess('zenity --question') as p:
            p.sleep(1)

            img = grab()
            rectangles = discover_buttons()
            print( rectangles )

    img = draw_indexed_rect_list(img, rectangles)
    img = autocrop(img)

    # display results
    img.show()