ENVI^  ForceLocal=1
LOGS * X.LOG
SET &fn=screen.png
SET &wid=0
CALL @WIN1

_SUB WIN1,W449H220,截图,
    LABE -VCENTER LABE1,L12T42W68H30,延时(秒):,,
    EDIT -VCENTER -3D Delay,L84T43W63H30,0,,
    SPIN SPIN1,L156T41W18H34,:0:100,,0x80,0x80
    ITEM ITEM1,L191T141W60H30,抓图, OnDo,
    LABE -VCENTER LABE2,L12T90W48H30,文件名,,
    EDIT -VCENTER -3D wFN,L70T90W335H30,%fn%,,
    ITEM ITEM2,L410T89W21H30,>>,OnBrow,
    LABE -VCENTER -RIGHT LABE3,L229T41W55H30,对象:,,
    EDIT -VCENTER -3D wWid,L291T41W90H30,%wid%,,
_END

_SUB OnBrow
    BROW &&fn,%wFN%,选择一个文件,PNG|*.PNG|BMP|*.BMP|JPG|*.JPG|GIF|*.GIF|TIFF|*.TIFF|所有|*.*
    FIND $%fn%=, EXIT
    ENVI @wFN=%fn%    
_END


_SUB OnDo
    SET &wid=%wWid%
    SET &fn=%wFN%
    FIND $%fn%=, EXIT
    ENVI @this.visable=0
    CALC &&ms=%Delay%
    CALC &ms=%&ms% * 1000#0
    IFEX $%ms%<0, SET ms=0
    CALC #&ms=%&ms% + 10
    WAIT %&ms%
    SCRN -cap %fn%,%wid%
    WAIT 10
    ENVI @this.visable=1
_END

