PixelChecksum

首页  后退  前进

PixelChecksum
down2

PixelChecksum

生成区域的像素校验和.

 

PixelChecksum ( left, top, right, bottom [, step = 1 [, hwnd [, mode = 0]]] )

参数

left

矩形的左上角水平坐标(X).

top

矩形的左上角垂直坐标(Y).

right

矩形的右下角水平坐标(X).

bottom

矩形的右下角垂直坐标(Y).

step

[可选] 每个象素的校验和使用大于 1 的值跳过校验的象素数量(提升执行速度).

例如,数值 2 表示每隔一个象素校验一次.

默认值为 1. 不推荐步进值超过 1.

hwnd

[可选] 目标窗口句柄. 默认为桌面窗口.

mode

[可选] 默认 0 = ADLER 校验; 1 = CRC32 校验.

返回值

成功:

返回区域的校验和值.

失败:

返回 0.

备注

校验和只能检查区域的"某些"变化 - 它并不能告诉你到底发生了什么变化.

 

CRC32 校检略比 ADLDER 校检慢, 但校检精度更高.

 

函数示例

#include <MsgBoxConstants.au3>
; Wait until something changes in the region 0,0 to 50,50
; Get initial checksum
Local $iCheckSum = PixelChecksum(0, 0, 50, 50)
; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $iCheckSum = PixelChecksum(0, 0, 50, 50)
    Sleep(100)
WEnd
MsgBox($MB_SYSTEMMODAL, "", "Something in the region has changed!")

----------------------------------------

 

该函数可以通过命令调用 exect

参见:

PixelGetColor, PixelCoordMode (Опция), PixelSearch

例子
copy

exect=$var_s=PixelChecksum(0,0,50,50)||_ViewValues('$var_s') ;; 得到初始校验和

up2

tcimage © Аверин Андрей для Total Commander Image Averin-And@yandex.ru