简体   繁体   English

如何在windows上的sikuli中唯一标识一张图片 10.我遇到异常

[英]How to uniquely identify an image in sikuli on windows 10. I'm getting an exception

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) .我在代码中的想法是为左侧的图像创建一个区域,然后单击该区域上的图像但是当我运行代码时出现以下异常:要搜索的图像 (650, 330) 大于要搜索的图像(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?那么如何使用sikuli唯一标识左边的图像呢? I'm using sikuli version 2.0.5我正在使用 sikuli 版本 2.0.5

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

Your Region is at (650, 330) with width/height 0 (which internally is 1 pixel).您的区域位于 (650, 330),宽度/高度为 0(内部为 1 像素)。

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

RaiMan from SikuliX来自 SikuliX 的 RaiMan

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

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