找回密码
 加入
搜索
查看: 6003|回复: 4

[图形处理] AVI如何循环播放?[已解决]

[复制链接]
发表于 2014-7-23 19:15:26 | 显示全部楼层 |阅读模式
本帖最后由 那片叶子 于 2014-7-23 22:49 编辑

以下播放AVI,如何循环播放啊!

#include <GUIConstants.au3>
$x=ObjCreate("WMPlayer.OCX")
$Form1 = GUICreate("AForm1", 500,400, 193, 200)
$Button1 = GUICtrlCreateButton("开始", 104, 344, 97, 33, 0)
$Button2 = GUICtrlCreateButton("停止", 272, 336, 121, 41, 0)
$sky=GUICtrlCreateObj($x, 100,50,500,500)
GUISetState(@SW_SHOW)
$x.uimode="none"
$x.url="1.avi"
$x.Controls.play

;MsgBox(0,"",$sky)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
   Case $GUI_EVENT_CLOSE
    Exit

EndSwitch
WEnd
发表于 2014-7-23 20:30:31 | 显示全部楼层
回复 1# 那片叶子
Global $oWMP = ObjCreate("WMPlayer.OCX")
Global $sCurrent_File = "1.avi"
;..........
AdlibRegister('_Looping_Play', 500)

;..................
Func _Looping_Play()
#cs
playState
3:正在播放 
2:暂停 
1:已停止
#ce
        If  $oWMP.playState = 1 Then
                $oWMP.url = $sCurrent_File
        $oWMP.Controls.play
        EndIf
EndFunc        
 楼主| 发表于 2014-7-23 21:36:16 | 显示全部楼层
回复 2# user3000


    能帮我 整合到上面的代码吗?谢谢
发表于 2014-7-23 22:17:57 | 显示全部楼层
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <wmp.au3>
#include <GuiAVI.au3>

$video = "1.avi"

$x = ObjCreate("WMPlayer.OCX")
$Form1 = GUICreate("AForm1", 500, 400, 193, 200)
$Button1 = GUICtrlCreateButton("开始", 104, 344, 97, 33, 0)
$Button2 = GUICtrlCreateButton("停止", 272, 336, 121, 41, 0)
$sky = GUICtrlCreateObj($x, 100, 50, 500, 500)
GUISetState(@SW_SHOW)
$x.uimode = "none"
$x.url = $video
$x.Controls.play

;MsgBox(0,"",$sky)
While 1
        $nMsg = GUIGetMsg()
        If $x.playState = 1 Then

                $x.Controls.play
        EndIf
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $x.url = $video
                        $x.Controls.play
                Case $Button2
                        _wmploadmedia($x, "stop")

        EndSwitch
WEnd
回复 3# 那片叶子
 楼主| 发表于 2014-7-23 22:49:11 | 显示全部楼层
回复 4# austere


    非常完美!非常感谢啊!~~~~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 13:47 , Processed in 0.074554 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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