Carico le 10 immagini

e le animo in sequenza con il Timer per contare i decimi di secondo

Aggiungo i pulsanti di Start e Stop

Carico le 12 immagini

e le animo in sequenza con il Timer

PERCORSO=Program.Directory
For i=0 To 11
IMG[i]=ImageList.LoadImage(PERCORSO + "\a" + i + ".gif")
EndFor
DIMX =ImageList.GetWidthOfImage (IMG[0])
DIMY =ImageList.GetHeightOfImage(IMG[0])
SPAZIO=10
POSX =SPAZIO
POSY =SPAZIO
GraphicsWindow.Title ="Animazione 0"
GraphicsWindow.BackgroundColor="Black"
GraphicsWindow.Width =DIMX+2*SPAZIO
GraphicsWindow.Height =DIMY+2*SPAZIO
Timer.Interval=250
Timer.Tick =AGGIORNA
frame=0
Sub AGGIORNA
frame=frame+1
If frame=12 Then
frame=0
EndIf
GraphicsWindow.DrawImage(IMG[frame],POSX,POSY)
EndSub
Aggiungo i pulsanti di Start e Stop

POSX1=DIMX+2*SPAZIO
POSY1=SPAZIO
POSX2=DIMX+2*SPAZIO
POSY2=2*SPAZIO+DIM_CMD
cmd_start=Controls.AddButton("START",POSX1,POSY1)
cmd_stop =Controls.AddButton("STOP" ,POSX2,POSY2)
Controls.SetSize(cmd_start,DIM_CMD,DIM_CMD)
Controls.SetSize(cmd_stop ,DIM_CMD,DIM_CMD)
GraphicsWindow.Width =DIMX+3*SPAZIO+DIM_CMD
GraphicsWindow.Height=DIMY+2*SPAZIO
Controls.ButtonClicked=CONTROLLO
Sub CONTROLLO
cmd=Controls.LastClickedButton
If cmd=cmd_start Then
START()
ElseIf cmd=cmd_stop Then
STOP()
EndIf
EndSub
Sub START
Timer.Resume()
EndSub
Sub STOP
Timer.Pause()