> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/image-search/wait-for-image.md).

# 等待图像

此操作使工具暂停并持续“监视”屏幕，直到目标图像出现（或超时）。

* 作用：非常必要以确保同步，确保网页或应用程序已加载完数据后工具才继续运行，避免脚本匆忙、步骤错乱或在网页尚未加载完成时误点击。

> ⚠️ 特别注意缩放比例（Scale）：截图时屏幕的缩放百分比和浏览器的分辨率必须与脚本实际运行时完全相同。如果在截图时您将屏幕显示设置为100%，但在运行系统配置文件时自动打开为80%或125%的缩放，图像扫描算法将无法识别目标的像素结构，从而导致结果偏差。

#### 实际示例：等待登录按钮完全显示

当您导航到一个网页时，由于网络速度的变化，“登录”按钮可能会立即出现或需要几秒钟才能加载完成。固定一个等待时间（Delay）可能会浪费时间，或者如果网络过慢仍然会出错。使用等待图像将使脚本处理更加灵活：

* 配置方法：您截取“登录”按钮的小图像作为样本图像，设置最大等待时间和图像扫描的准确性。
* 结果：脚本将主动等待，一旦“登录”按钮在屏幕上显示，系统将立即识别并转向下一步操作，而无需浪费多余的等待时间。

> 💡 *详细参数如样本图像区域（Image）、等待时间（Timeout）、颜色偏差（Threshold）、真实色彩（True color）和输出变量（Output）将在结合三项操作的指南部分深入分析：等待图像、图像存在和图像搜索。*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/image-search/wait-for-image.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
