Sub btn_load_gif_askisis_Click
'Try
Timer1.Initialize("Timer1",0) 'πρεπει να γινεται και εδω initialize γιατι αλλιως σκαει ο TIMER
Dim what_picture As String
gif.DisposeFrames
If number_askisis=1 Then what_picture="BBBenchPress-no1.gif"
If number_askisis=2 Then what_picture="BBInclineBenchPress-no2.gif"
If number_askisis=3 Then what_picture="BBDeclineBenchPress-no3.gif"
If number_askisis=4 Then what_picture="DBBenchPress-no4.gif"
If number_askisis=5 Then what_picture="DBDeclineBenchPress-no5.gif"
If number_askisis=6 Then what_picture="DBInclineBenchPress-no6.gif"
If number_askisis=7 Then what_picture="DBPullover-no7.gif"
If number_askisis=8 Then what_picture="DBFly-no8.gif"
If number_askisis=9 Then what_picture="BBDeadlift-no9.gif"
If number_askisis=10 Then what_picture="Clean-no10.gif"
If number_askisis=11 Then what_picture="WTChinUp-no11.gif"
If number_askisis=12 Then what_picture="WTpullUp-test-no12.gif"
If number_askisis=13 Then what_picture="WTRearPullup-no13.gif"
If number_askisis=14 Then what_picture="CBFrontPulldown-no14.gif"
If number_askisis=15 Then what_picture="DBBentoverRow-no15.gif"
If number_askisis=16 Then what_picture="BBBentOverRow-no16.gif"
gif.Load(File.DirAssets,what_picture)
'ToastMessageShow(gif.FrameCount & " frames", True)
Frame = 0
Timer1.Interval = gif.Delay(Frame)
ImageView1.Bitmap = gif.Frame(Frame)
Timer1.Enabled = True
gif.SaveFrame(0, File.DirRootExternal, "frame0.png", "P", 85)
gif.SaveFrame(0, File.DirRootExternal, "frame0.jpg", "J", 85)
'Catch
'Msgbox("PLEASE CHOOSE AN EXERCISE FIRST !","")
'End Try
End Sub
Sub Timer1_Tick
Timer1.Enabled = False
Frame = Frame + 1
If Frame >= gif.FrameCount Then
Frame = 0
End If
Timer1.Interval= gif.Delay(Frame)
ImageView1.Bitmap = gif.Frame(Frame)
Timer1.Enabled = True
End Sub