如何在 Windows 10 上的 sikuli 中唯一标识图像。我遇到异常

发布于 2025-01-12 13:05:40 字数 397 浏览 0 评论 0原文

我有两张相似的图像,一张图像位于屏幕的左侧,一张图像位于屏幕的右侧。我想单击左侧的图像。

我在代码中的想法是为左侧的图像创建一个区域,然后单击该区域上的图像,但是当我运行代码时,出现以下异常: 要搜索的图像 (650, 330) 大于要在 (1, 1) 中搜索的图像


Region region = new Region(650,330,0,0); 
Pattern element = region.find("myimage.png");
Screen screen = element.getScreen();
screen.doubleClick();

那么如何使用sikuli唯一识别左侧的图像呢?我使用的是sikuli版本2.0.5

I have two similar images, one image is on the left and one is on the right hand side of the screen. I want to click on the image on the left.

My idea in the code is to create a region for the image on the left then click the image on that region but when I run a code I get the following exception:
image to search (650, 330) is larger than image to search in (1, 1).


Region region = new Region(650,330,0,0); 
Pattern element = region.find("myimage.png");
Screen screen = element.getScreen();
screen.doubleClick();

So how can I uniquely identify the image on the left using sikuli? I'm using sikuli version 2.0.5

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

向日葵 2025-01-19 13:05:40

定义一个区域:new Region(x, y, w, h)

您的区域位于 (650, 330),宽度/高度为 0(内部为 1 像素)。

Region region = new Region(0, 0, 650,330); 
Match match = region.find("myimage.png");
match.doubleClick();

SikuliX 的 RaiMan

A Region is defined: new Region(x, y, w, h)

Your Region is at (650, 330) with width/height 0 (which internally is 1 pixel).

Region region = new Region(0, 0, 650,330); 
Match match = region.find("myimage.png");
match.doubleClick();

RaiMan from SikuliX

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文