← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #693662]: VNCScreen.capture doesnt work

 

Question #693662 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/693662

Jeff_Vallis posted a new comment:
May or May not help
My Screen Shot Function - please don't Laugh

def Screen_Shot_Set_and_Copy_Procedure(v_Dir,Screen_Shot_File,Need_a_Copy,x,y,w,h):
    screenshotsDir = Get_Location(v_Dir)    
    import shutil
    import os
    print "Screen_Shot_Set_and_Copy",x,y,w,h
    setRect(x,y,w,h)
    some_region = SCREEN # for whole screen
    someRegion = App.focusedWindow() # for the frontmost windo
    img = capture(some_region)
    my_file = Screen_Shot_File
    print "Sub_Take_Screen_Shot_and_Copy() "+screenshotsDir + my_file + ".png" 
    localtime = time.localtime(time.time())
    timestring = time.strftime ('%m%d%H%M%S')
    my_file = my_file + ".png"
    shutil.move(img, os.path.join(screenshotsDir, my_file))
    if Need_a_Copy == 1:
        my_copy = my_file + " copy " + timestring + ".png"
        shutil.copy(os.path.join(screenshotsDir, my_file), os.path.join(screenshotsDir, my_copy))
        print "Sub_Take_Screen_Shot_and_Copy() ",screenshotsDir, my_copy

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.