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

    Status: Answered => Open

Ignasi Bernadas is still having a problem:
I know this is an error for this screen but my sikuli program  still
works and I don't want an error code in the logs that doesn't affect to
the execution of the code.

Here is the code (aprox) that produces this error.

bottom = Region(0,940,1920,140)

def adaptToScreenResolution():
        width = float(getW())
        height = float(getH())
        if width != 1920 or height != 1080:
            global bottom
            bottom = resizeRegion(bottom, width, height)

def resizeRegion(region, screenW, screenH):
    resizeFactorX = screenW/1920
    resizeFactorY = screenH/1080
    
    X = int(round(region.getX()*resizeFactorX))
    Y = int(round(region.getY()*resizeFactorY))
   W = int(round(region.getW()*resizeFactorX))
    H = int(round(region.getH()*resizeFactorY))
    
    return Region(X, Y, W, H)

adaptToScreenResolution()

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

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to