本文整理汇总了Python中org.sikuli.script.Screen.getPrimaryId方法的典型用法代码示例。如果您正苦于以下问题:Python Screen.getPrimaryId方法的具体用法?Python Screen.getPrimaryId怎么用?Python Screen.getPrimaryId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sikuli.script.Screen
的用法示例。
在下文中一共展示了Screen.getPrimaryId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from org.sikuli.script import Screen [as 别名]
# 或者: from org.sikuli.script.Screen import getPrimaryId [as 别名]
def __init__(self, id=None):
if DEBUG: print "**IN*** Jython INIT Screen"
if id != None:
r = JScreen.getBounds(id)
else:
r = JScreen.getBounds(JScreen.getPrimaryId())
(x, y, w, h) = (int(r.getX()), int(r.getY()), \
int(r.getWidth()), int(r.getHeight()))
Region.__init__(self, x, y, w, h)
self.setScriptingType("JythonScreen")
if DEBUG: print "**OUT** Jython INIT Screen"
示例2: __init__
# 需要导入模块: from org.sikuli.script import Screen [as 别名]
# 或者: from org.sikuli.script.Screen import getPrimaryId [as 别名]
def __init__(self, id=None):
try:
if id != None:
r = JScreen.getBounds(id)
s = JScreen.getScreen(id)
else:
id = JScreen.getPrimaryId()
r = JScreen.getBounds(id)
s = JScreen.getScreen(id)
(self.x, self.y, self.w, self.h) = (int(r.getX()), int(r.getY()), \
int(r.getWidth()), int(r.getHeight()))
self.initScreen(s)
except:
Debug.log(3, "Jython: init: exception while initializing Screen\n%s", sys.exc_info(0))
sys.exit(1)