Spielt einen AVI-Clip in einem Animations-Control ab
#include <GuiAVI.au3>
_GUICtrlAVI_Play ( $hWnd [, $iFrom = 0 [, $iTo = -1 [, $iRepeat = -1]]] )
$hWnd | Control-ID / Handle des Controls |
$iFrom | [optional] 0-basierender Index des Frames wo die Datei startet. Der Wert muss kleiner als 65.536 sein. Ein Wert von 0 bedeutet, dass der Clip beim ersten Frame beginnt. |
$iTo | [optional] 0-basierender Index des Frames wo die Datei endet. Der Wert muss kleiner als 65.536 sein. Ein Wert von -1 bedeutet, dass der Clip beim letzten Frame endet. |
$iRepeat | [optional] Anzahl der Wiederholungen. Ein Wert von -1 bedeutet, dass der Clip unendlich wiederholt wird. |
Erfolg: | True |
Fehler: | False |
Das Control spielt den Clip im Hintergrund ab, während das Skript weiterläuft.
- - - - - - - - Erklärung der Controls - - - - - - - -
_GUICtrlAVI_Seek, _GUICtrlAVI_Stop
; verwendet die AuotIt-Funktion
#include <GuiAVI.au3>
#include <GUIConstantsEx.au3>
_Example_Internal()
Func _Example_Internal()
Local $idAVI, $id_Start, $id_Stop
; Erstellt eine GUI
GUICreate("AVI: Abspielen / Stoppen (Intern)", 300, 200)
$idAVI = GUICtrlCreateAvi(@SystemDir & "\shell32.dll", 160, 10, 10)
$id_Start = GUICtrlCreateButton("Start", 50, 150, 70, 22)
$id_Stop = GUICtrlCreateButton("Stopp", 150, 150, 70, 22)
GUISetState(@SW_SHOW)
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $id_Start
; Spielt einen Tel des AVI Clips ab
_GUICtrlAVI_Play($idAVI)
Case $id_Stop
; Stoppt den AVI Clip
_GUICtrlAVI_Stop($idAVI)
EndSwitch
WEnd
; Schließt den AVI Clip
_GUICtrlAVI_Close($idAVI)
GUIDelete()
EndFunc ;==>_Example_Internal
; verwendet die UDF
#include <GuiAVI.au3>
#include <GUIConstantsEx.au3>
_Beispiel_External()
Func _Beispiel_External()
Local $hGui, $hAVI, $id_Start, $id_Stop
; Erstellt eine GUI
$hGui = GUICreate("AVI: Abspielen (Extern)", 300, 200)
$hAVI = _GUICtrlAVI_Create($hGui, @SystemDir & "\Shell32.dll", 160, 10, 10)
$id_Start = GUICtrlCreateButton("Start", 50, 150, 70, 22)
$id_Stop = GUICtrlCreateButton("Stopp", 150, 150, 70, 22)
GUISetState(@SW_SHOW)
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $id_Start
; Spielt einen Tel des AVI Clips ab
_GUICtrlAVI_Play($hAVI)
Case $id_Stop
; Stoppt den AVI Clip
_GUICtrlAVI_Stop($hAVI)
EndSwitch
WEnd
; Schließt den AVI Clip
_GUICtrlAVI_Close($hAVI)
GUIDelete()
EndFunc ;==>_Beispiel_External