找回密码
 加入
搜索
查看: 1816|回复: 6

[AU3基础] 定時拍照回圈??[已解決]

  [复制链接]
发表于 2012-2-21 20:48:18 | 显示全部楼层 |阅读模式
本帖最后由 jericho0711 于 2012-2-23 20:55 编辑

最後直接改用hotkey的方式去做...

想做一個定時拍照的迴圈,時間還沒到的時候,可以直接按下button去離開,如果不按下button,時間到後會自動跳出,但迴圈的部分只有時間到到會跳出,按下button沒有作用,有辦法讓迴圈中按下button就直接跳出嗎??
While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
         Case $Button1
                   Exit                                                                          
   EndSwitch
   If $x = 3 Then
   Exit
   Else
   Sleep("1800000")
   _ScreenCapture_Capture(@DesktopDir & "\0" & $x & ".jpg")
   $x += 1
   EndIf
WEnd
发表于 2012-2-21 21:12:47 | 显示全部楼层
不用Sleep() 就可以
 楼主| 发表于 2012-2-21 21:31:06 | 显示全部楼层
回复 2# afan

但希望_ScreenCapture_Capture 這個能30分鐘拍一張照片,有其他的方法去做固定時間的拍照嗎?
发表于 2012-2-21 22:05:48 | 显示全部楼层

#include <GUIConstantsEx.au3>
$Form1 = GUICreate("Form1", 623, 442, -1, -1)
$Button1 = GUICtrlCreateButton("Button1", 200, 176, 177, 73)
$Label1 = GUICtrlCreateLabel("Label1", 256, 104, 36, 17)
GUISetState(@SW_SHOW)
$timer = TimerInit()
While 1
        $dif = TimerDiff ($timer)
        If $dif > 3000 Then
                GUICtrlSetData ($Label1,@SEC)
                $timer = TimerInit()
        EndIf        
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        Exit
        EndSwitch
WEnd

三秒更新一下Label1  用AdlibRegister 注册一个应该更完美一些  但是不要加sleep

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

 楼主| 发表于 2012-2-22 09:46:40 | 显示全部楼层
回复 4# zch11230


看來如果要定時拍照又要迴圈,比較簡單的方式應該是使用hotkey去跳出迴圈,晚點再來試試hotkey的方式..
发表于 2012-2-26 17:20:31 | 显示全部楼层
其实用AdlibRegister就行了
发表于 2012-2-26 21:04:04 | 显示全部楼层
居然用“決”,难怪没自动转移到已解决区。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-30 21:23 , Processed in 0.107851 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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