Lionheart008
09-12-2009, 17:23
hello.
how to load an "*.avi" file ?
Wanted to load simple "clock.avi" for some seconds.
my example:
' Empty GUI script created on 12-09-2009 11:55:18 by (ThinAIR)
Uses "console", "ui"
%Anim_Start = %WM_USER + 500
%Anim_Stop = %WM_USER + 501
%Anim = %WM_USER + 502
%Textboxy = %WM_USER + 503
CallBack Function DlgProc () As Long
Static myAnimate As Long
Local s As String = APP_SourcePath + "Clock.AVI"
Select Case CBMSG
Case %WM_INITDIALOG
Control HANDLE CBHNDL, %Anim To myAnimate
Animate_Open (APP_SourcePath, myAnimate + "Clock.AVI") '
PrintL "avi loaded?"
Case %WM_COMMAND
If CBCTLMSG <> %BN_CLICKED Then Exit Select
Select Case CBCTL
Case %Anim_Start
Control DISABLE CBHNDL, %Anim_Start
Control ENABLE CBHNDL, %Anim_Stop
Control SET FOCUS CBHNDL, %Anim_Stop
Animate_Play(myAnimate, 0, -1, -1)
Case %Anim_Stop
Control DISABLE CBHNDL, %Anim_Stop
Control ENABLE CBHNDL, %Anim_Start
Control SET FOCUS CBHNDL, %Anim_Start
Animate_Stop(myAnimate)
Case %IDCANCEL
Dialog End CBHNDL
End Select
Case %WM_SYSCOLORCHANGE
Control SEND CBHNDL, %Anim, CBMSG, CBWPARAM, CBLPARAM
End Select
End Function
Function TBMAIN () As Long
Local hDlg As DWord
Dialog NEW 0, "my TB AnimationDemo",-1,-1, 215, 160, %WS_CAPTION Or %WS_SYSMENU, _
0 To hDlg
Control ADD BUTTON, hDlg, %anim_start, "StartAvi", 6, 80, 55, 16
Control ADD BUTTON, hDlg, %anim_stop, "StopAvi", 65, 80, 55, 16, _
%WS_DISABLED Or %WS_TABSTOP
Control ADD BUTTON, hDlg, %IDCANCEL, "ExitGui", 124, 80, 55, 16
Control ADD TEXTBOX, hDlg, %Textboxy, "=> avi-infos..", 10,120,85,16
Control ADD "SysAnimate32", hDlg, %anim, "", 6, 6, 172, 24, _
%WS_CHILD Or %WS_VISIBLE Or %ACS_CENTER Or %ACS_TRANSPARENT
Dialog SET GRADIENT hDlg, %GRADIENT_FILL_H, RGB(255,100,10), RGB(0,100,255)
Dialog SHOW MODAL hDlg Call DlgProc
End Function
I am missing
a) Animate_Open
b) Animate_Start
c) Animate_Stop
description in manual help ;)
frank
how to load an "*.avi" file ?
Wanted to load simple "clock.avi" for some seconds.
my example:
' Empty GUI script created on 12-09-2009 11:55:18 by (ThinAIR)
Uses "console", "ui"
%Anim_Start = %WM_USER + 500
%Anim_Stop = %WM_USER + 501
%Anim = %WM_USER + 502
%Textboxy = %WM_USER + 503
CallBack Function DlgProc () As Long
Static myAnimate As Long
Local s As String = APP_SourcePath + "Clock.AVI"
Select Case CBMSG
Case %WM_INITDIALOG
Control HANDLE CBHNDL, %Anim To myAnimate
Animate_Open (APP_SourcePath, myAnimate + "Clock.AVI") '
PrintL "avi loaded?"
Case %WM_COMMAND
If CBCTLMSG <> %BN_CLICKED Then Exit Select
Select Case CBCTL
Case %Anim_Start
Control DISABLE CBHNDL, %Anim_Start
Control ENABLE CBHNDL, %Anim_Stop
Control SET FOCUS CBHNDL, %Anim_Stop
Animate_Play(myAnimate, 0, -1, -1)
Case %Anim_Stop
Control DISABLE CBHNDL, %Anim_Stop
Control ENABLE CBHNDL, %Anim_Start
Control SET FOCUS CBHNDL, %Anim_Start
Animate_Stop(myAnimate)
Case %IDCANCEL
Dialog End CBHNDL
End Select
Case %WM_SYSCOLORCHANGE
Control SEND CBHNDL, %Anim, CBMSG, CBWPARAM, CBLPARAM
End Select
End Function
Function TBMAIN () As Long
Local hDlg As DWord
Dialog NEW 0, "my TB AnimationDemo",-1,-1, 215, 160, %WS_CAPTION Or %WS_SYSMENU, _
0 To hDlg
Control ADD BUTTON, hDlg, %anim_start, "StartAvi", 6, 80, 55, 16
Control ADD BUTTON, hDlg, %anim_stop, "StopAvi", 65, 80, 55, 16, _
%WS_DISABLED Or %WS_TABSTOP
Control ADD BUTTON, hDlg, %IDCANCEL, "ExitGui", 124, 80, 55, 16
Control ADD TEXTBOX, hDlg, %Textboxy, "=> avi-infos..", 10,120,85,16
Control ADD "SysAnimate32", hDlg, %anim, "", 6, 6, 172, 24, _
%WS_CHILD Or %WS_VISIBLE Or %ACS_CENTER Or %ACS_TRANSPARENT
Dialog SET GRADIENT hDlg, %GRADIENT_FILL_H, RGB(255,100,10), RGB(0,100,255)
Dialog SHOW MODAL hDlg Call DlgProc
End Function
I am missing
a) Animate_Open
b) Animate_Start
c) Animate_Stop
description in manual help ;)
frank