Picture slide show

Post

Posted
Rating:
#1 (In Topic #694)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 Hi Everyone,

Does any have or know of a Picture slide show done in Gambas?
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
vuott is in the usergroup ‘Regular’
 …by using a Picture[ ] or Image[ ] array…

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#3
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
Could that be controlled by a timer? To say loop though each pic and show it for 20 seconds at a time?
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
vuott is in the usergroup ‘Regular’
Of course, try it.   :)

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#5
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
I will thanks for the advice
Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’
Should be simple. Something like..
Add a PictureBox called PictureBox1 and a timer called PictureTimer…

Code (gambas)

  1. Public ListPos As Integer
  2. Public dirList As String[]
  3.  
  4. Public Sub startshow(Folder As String)
  5.  
  6. ListPos = 0
  7. dirList = []
  8. Dim files as String[] = Dir(Folder)
  9. For Each s As String In files
  10. Dim ext As String = File.Ext(s)
  11. If ext = "jpg" Or Ext = "png" Then dirList.Add(s)
  12.  
  13. PictureTimer.Start
  14.  
  15. Public Sub PictureTimer_Timer()
  16. PictureBox1.Picture = Picture.Load(dirList[ListPos])
  17. If Listpos = dirList.Max then ListPos = 0 Else Inc ListPos
  18.  
Something like that
(I typed this on my phone at work so could be errors, just an example)
Online now: No Back to the top

Post

Posted
Rating:
#7
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
Thanks Bruce it will give me something to start with
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Guru
cogier is in the usergroup ‘Guru’
Run this code in a new Graphical Application. It assumes you have some .jpg files in your Pictures folder.

Code (gambas)

  1. sPath As String = User.Home &/ "Pictures"
  2. sPictures As String[] = Dir(sPath, "*.jpg")
  3. iCount As Integer
  4. PictureBox1 As PictureBox
  5. Timer1 As Timer
  6.  
  7. Public Sub Form_Open()
  8.  
  9.   BuildForm
  10.  
  11.  
  12. Public Sub Timer1_Timer()
  13.  
  14.   Try PictureBox1.Picture = Picture.Load(sPath &/ sPictures[iCount])
  15.   Me.Text = sPictures[iCount]
  16.   Inc iCount
  17.   If iCount = sPictures.Count Then iCount = 0
  18.  
  19.  
  20. Public Sub BuildForm()
  21.  
  22.   With Me
  23.     .Height = 700
  24.     .Width = 1000
  25.     .Padding = 5
  26.     .Arrangement = Arrange.Vertical
  27.     .Center
  28.  
  29.   With PictureBox1 = New PictureBox(Me) As "PictureBox1"
  30.     .Expand = True
  31.     .Mode = PictureBox.Contain
  32.     .Alignment = Align.Center
  33.  
  34.   With Timer1 = New Timer As "Timer1"
  35.     .Enabled = True
  36.     .Delay = 2000
  37.  
Online now: No Back to the top
1 guest and 0 members have just viewed this.