' utility to save images from a VB6 imagelist - example ExtractVB6ImageListImages(ImageListModes,"ImageListModes")
Function ExtractVB6ImageListImages(myimagelist As ImageList, listname As String)
Dim nCount As Integer
Dim nIndex As Integer
Dim sKey As String
Dim temp As Image
nCount = myimagelist.ListImages.count()
For nIndex = 1 To nCount
If nIndex < 10 Then
SavePicture myimagelist.ListImages(nIndex).Picture, listname + "00" + Mid(Str(nIndex), 2) + ".bmp"
ElseIf nIndex < 100 Then
SavePicture myimagelist.ListImages(nIndex).Picture, listname + "0" + Mid(Str(nIndex), 2) + ".bmp"
Else
SavePicture myimagelist.ListImages(nIndex).Picture, listname + Mid(Str(nIndex), 2) + ".bmp"
End If
Next
End Function
source
share