View Single Post
Old Feb 17th, 2006, 5:37 PM   #3
melbolt
Hobbyist Programmer
 
melbolt's Avatar
 
Join Date: Feb 2005
Location: PA, USA
Posts: 237
Rep Power: 4 melbolt is on a distinguished road
Send a message via AIM to melbolt Send a message via Yahoo to melbolt
Quote:
Originally Posted by Austin123
Now to the dilemma: I've gotten all the images created for the program and the layout of the program is complete, the problem is I haven't had much luck populating a ListView with the jpegs of a folder; actually, I've had even less luck with parsing the images into an imagelist...and now I'm at a complete loss.
to add an image to your image list, you could do this:

Private Sub AddImageToList(imageToLoad As String)

            If imageToLoad <> "" Then
                imageList1.Images.Add(Image.FromFile(imageToLoad))
            End If

End Sub


where imageToLoad parameter is simply the path to the image.


if you wanted to use an openfiledialogue control you could get the image's filenames like so:

openFileDialog1.Multiselect = True

If openFileDialog1.ShowDialog() = DialogResult.OK Then
'for multiple images selected
                If Not (openFileDialog1.FileNames Is Nothing) Then
                    Dim i As Integer
                    For i = 0 To openFileDialog1.FileNames.Length - 1
                        addImage(openFileDialog1.FileNames(i))
                    Next i
                Else
'for a single image selected
                    addImage(openFileDialog1.FileName)
                End If
End If

http://msdn.microsoft.com/library/de...classtopic.asp


btw, VB .NET is not a scripting language, its compiled

if you have more questions you can post back and i'll try to check again, i'm not really sure how you want this program to work. is it to get all the images out of a folder or is it letting the user select them?
__________________
I have never let my schooling interfere with my education. -Mark Twain-

Xbox live gamertag: melbolt
melbolt is offline   Reply With Quote