Hi Kejpa
Try this for starters:
You would want to add in checking for the directory existing, and handle
file extensions better - but you get the idea.
HTH
Nigel
Code to use the module:
Util.ImageListToFiles(Me.ImageList1, "C:\test\",
System.Drawing.Imaging.ImageFormat.Jpeg)
Module:
Public Module Util
Sub ImageListToFiles(ByVal list As ImageList, ByVal rootDirectory As
String, ByVal format As System.Drawing.Imaging.ImageFormat)
Dim i As Integer = 0
For Each im As Image In list.Images
' format.ToString is a bit of a hack...you would probably want to
' do a Select Case on it to get more control over the file
extension
im.Save(rootDirectory & i & "." & format.ToString(), format)
i += 1
Next
End Sub
End Module
"Kejpa" wrote:
Hi,
does anyone have a sub for exporting the images (all or selected) of an
imagelist as files?
TIA
Kejpa