找回密码
 加入
搜索
查看: 72|回复: 0

屏幕截图查找某个字的坐标并返回其坐标。

  [复制链接]
发表于 2025-4-20 20:35:13 | 显示全部楼层 |阅读模式
本帖最后由 xsjtxy 于 2025-4-22 13:49 编辑

求教如何将屏幕截图并查找某个关键字的坐标并返回其X,Y坐标。

通过PixelSearch检测象素的方式实现了。点击360浏览器里面的按键。


Opt("WinTitleMatchMode", 2)

MouseMove(1,1)
WinActivate("360极速浏览器")
sleep(2000)

$coord = PixelSearch(386,30,386,750,5465201)
If Not @error Then
While 1
;MsgBox(0, "X 与 Y 坐标:", $coord[0] & "," & $coord[1])
if PixelGetColor(386,$coord[1]+1)<>11713216 then ExitLoop
if PixelGetColor(386,$coord[1]+2)<>16777215 then ExitLoop
if PixelGetColor(386,$coord[1]+3)<>16777215 then ExitLoop
if PixelGetColor(386,$coord[1]+4)<>16777215 then ExitLoop
if PixelGetColor(386,$coord[1]+5)<>16777215 then ExitLoop
if PixelGetColor(386,$coord[1]+6)<>16777215 then ExitLoop
if PixelGetColor(386,$coord[1]+7)<>16777215 then ExitLoop
if PixelGetColor(386,$coord[1]+8)<>16777215 then ExitLoop
if PixelGetColor(386,$coord[1]+9)<>11910338 then ExitLoop
$d2=PixelGetColor(386,$coord[1]+10)
if $d2 = 5465201 then
MouseMove($coord[0],$coord[1])
sleep(1000)
MouseClick("left")
endif
ExitLoop
WEnd
EndIf


您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2025-4-30 12:40 , Processed in 0.167535 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表