AutoJs6
AutoJs6 copied to clipboard
在截图及OCR时偶尔会出现下面的报错
java.lang.IllegalArgumentException: y + height must be <= bitmap.height() 脚本代码如下: let src = images.captureScreen(); let left = 300, top = 1200, right = 700, bottom = 1600, width = right - left, height = bottom - top; let img = images.clip(src, left, top, width, height); let results = ocr.detect(img);
偶尔是会遇到,用try catch跳过错误
我的也有这种情况,我保存查看横向截屏时,截的图像是竖屏,上下都是空白,类似于横屏短视频用竖屏观看那种情况,导致之前的clip坐标定位不准,无法进行后续操作。之前运行的好好的,突然就这样了,换设备也不行。