T
Terry Olsen
I have the following code:
Private Sub LoadImageList()
Dim il As New ImageList
Dim di As New DirectoryInfo(ImgDir)
For Each fi As FileInfo In di.GetFiles
Dim bmp As Image = DevIL.DevIL.LoadBitmap(fi.FullName)
PictureBox1.Image = bmp
il.Images.Add(fi.FullName, PictureBox1.Image)
Next
ImgList.LargeImageList = il
End Sub
Even though the PictureBox can display the image, I get the following error
when trying to add the image to the ImageList.
"Image added to an ImageList must either derive from Image or be an Icon."
How can I fix this?
Thanks.
Private Sub LoadImageList()
Dim il As New ImageList
Dim di As New DirectoryInfo(ImgDir)
For Each fi As FileInfo In di.GetFiles
Dim bmp As Image = DevIL.DevIL.LoadBitmap(fi.FullName)
PictureBox1.Image = bmp
il.Images.Add(fi.FullName, PictureBox1.Image)
Next
ImgList.LargeImageList = il
End Sub
Even though the PictureBox can display the image, I get the following error
when trying to add the image to the ImageList.
"Image added to an ImageList must either derive from Image or be an Icon."
How can I fix this?
Thanks.