function main()  

--获取屏幕的分辨率
w,h = getScreenResolution();
--显示屏幕长、宽
notifyMessage(string.format("%d,%d\n",w,h));
mSleep(500);

-- 点击函数
appRun("com.tencent.xin");
mSleep(500)
--指定截图保存路径
snapshotRegion("var/mobile/Applications/back.bmp",3,65,100,110);
	mSleep(500);
	
	notifyMessage("没有找到");
end

针对上次截图,实现找图功能:

image_x,image_y = findImageInRegion("var/mobile/Applications/back.bmp",3,65,100,110);
	mSleep(500);
	if image_x ~= -1 and  image_y ~= -1 then
		notifyMessage("找到图");
		else
			notifyMessage("没有找到图");
			end;

其他截图和找图可以利用类似的方法做到

不积跬步无以至千里

posted on 2015-05-07 17:23  奋斗的虫虫  阅读(1868)  评论(0编辑  收藏  举报