Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a photo album

Status
Not open for further replies.

tag141

Technical User
Oct 4, 2003
119
AU
Did a quick search but can't seem to find any suitable results. What I would like to know is does this sound feasable.
In a folder called 'images' are three subfolders '1', '2', and '3' which contain images. I want to build a slideshow that pulls and displays a random image from each folder and cycles through all three, each time displaying a random image. (if the same one is displayed, so be it). While it's cycling, I decide to download another folder '4' into the images main folder (so it now contains 4 subfolders). I now want the program to 'pick up' the new folder and display a random image as well as the first three. Is this possible (and fairly easy) using VB6 or would another language be easier. (I don't particularly want it to run in a browser like it could if I used javascript.)

TIA.
 
I tell you what I did for a screensaver I made. I wanted to show in random all my pics that where in several folders...
What I did is I used a dir object to get all the directories names inside mi picture dir (example, mypicx\xmas, mypicx\birthday, etc)
Then I used a hidden listbox and a filelist control. What I did I surfed all the dirs listend in dir1.path so file1.path = dir1.path and I copied all entries to the listbox then I wait for a random number between 1 and list1.listcount and show the list1.list(randomnumber) in a picturebox. pict1.picture = loadpicture list1.list(randomnumber)
If you want to ckeck for a new dir while excecuting you can use a timer to update the list contents.
Hope it helps, its easy and quick.
 
An ideal use for the FileSystemObject! (see VBHelp and many posts within this forum).

FSO has a Folders collection that you can loop through, and each Folder has a Files collection. These 2 together will easily solve your problem

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top