Picture slide show
Posted: Monday 28th June 2021 11:53pm
Hi Everyone,
Does any have or know of a Picture slide show done in Gambas?
Does any have or know of a Picture slide show done in Gambas?
Public ListPos As Integer
Public dirList As String[]
Public Sub startshow(Folder As String)
ListPos = 0
dirList = []
Dim files as String[] = Dir(Folder)
For Each s As String In files
Dim ext As String = File.Ext(s)
If ext = "jpg" Or Ext = "png" Then dirList.Add(s)
Next
PictureTimer.Start
End
Public Sub PictureTimer_Timer()
PictureBox1.Picture = Picture.Load(dirList[ListPos])
If Listpos = dirList.Max then ListPos = 0 Else Inc ListPos
End
Something like that sPath As String = User.Home &/ "Pictures"
sPictures As String[] = Dir(sPath, "*.jpg")
iCount As Integer
PictureBox1 As PictureBox
Timer1 As Timer
Public Sub Form_Open()
BuildForm
End
Public Sub Timer1_Timer()
Try PictureBox1.Picture = Picture.Load(sPath &/ sPictures[iCount])
Me.Text = sPictures[iCount]
Inc iCount
If iCount = sPictures.Count Then iCount = 0
End
Public Sub BuildForm()
With Me
.Height = 700
.Width = 1000
.Padding = 5
.Arrangement = Arrange.Vertical
.Center
End With
With PictureBox1 = New PictureBox(Me) As "PictureBox1"
.Expand = True
.Mode = PictureBox.Contain
.Alignment = Align.Center
End With
With Timer1 = New Timer As "Timer1"
.Enabled = True
.Delay = 2000
End With
End