简体   繁体   English

Sikuli仅在主屏幕上识别图像

[英]Sikuli recognizes images on the main screen only

I'm working on a Sikuli project and using a multi-screen platform to do so. 我正在研究Sikuli项目,并使用多屏幕平台来实现。 Right now Sikuli does not recognize images on my secondary screen. 目前,Sikuli无法识别辅助屏幕上的图像。

I've been given a Sikuli executer class that I can use in my work but cannot change. 我得到了一个Sikuli执行器类,可以在我的工作中使用它,但是不能更改。 The class, amongst other things, defines a Screen instance to recognize images on, like so: 该类除其他外,定义了一个Screen实例来识别图像,如下所示:

Screen screen = new Screen();

Sikuli documentation says that this way the object representing the primary monitor is created. Sikuli文档说,这样可以创建代表主监视器的对象。

Question: How do I make Sikuli recognize images on both screens if I cannot modify the executer class? 问题:如果无法修改执行程序类,如何使Sikuli识别两个屏幕上的图像?

I am not sure what you mean when you say "executer class" but generally, if for some reason you can't just define another Screen object that points to a non-primary monitor (eg Screen sc2 = new Screen(1) ), you can define a object of class ScreenUnion() like this: 我不确定您所说的“执行程序类”是什么意思,但是通常来说,如果由于某种原因您不能仅仅定义另一个指向非主要监视器的Screen对象(例如Screen sc2 = new Screen(1) ),您可以像这样定义ScreenUnion()类的对象:

Screen union = Screen.all();

This will result in a single screen area that covers all detected monitors and will start at 0,0 on the primary screen. 这将导致一个屏幕区域覆盖所有检测到的监视器,并且将从主屏幕的0,0开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM