|
-
Jul 5th, 2002, 10:52 AM
#1
Thread Starter
Junior Member
Loading An Image List
Hi this seems to be a tough one for me but i hope someone here can help
i have a huge list of images (huge being well over 1000)
what would be the fastest way to load them imto VB??
at the moment it goes through this list picture by picture then it loads each images into a picture box like this
picture(n).picture = loadpicture(selected & ".gif")
selected is the name of the image that is to be loaded ehich is the 1 it is up to in the list
ne suggestions??
martyn
-
Jul 6th, 2002, 10:30 AM
#2
Lively Member
name your images by number, for example image0.gif, image1.gif, etc. then load each image into a picture array using a loop
dim myImages(1000) as picture
dim i%
for i = 0 to 999
'set the path to wherever you have the images saved
set myImages(i) = LoadPicture(app.path & "\images\image" & _
i & ".gif")
next i
'now you can just reference the picture using the variable
picture1.picture = myImages(1)
image1.picture = myImagaes(2)
...etc
-
Jul 6th, 2002, 01:30 PM
#3
Thread Starter
Junior Member
cheers
that speeds it up quite a bit as im using the same images many times and it saves loading the same images again and again. is there any way i can call each image by text rather than a number? eg
picture1.picture = myimages("A0A0")
-
Jul 6th, 2002, 06:02 PM
#4
Thread Starter
Junior Member
dont worry i hav sorted it
i used the code u gave (which was a huge help and much faster) then added each one 2 a collection and gave it a name and called each picture from the collecetion
thanks for the help
martyn
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|