VB6 Extract Images (any kind) from a ImageList

illumi picture illumi · Mar 15, 2011 · Viewed 8.5k times · Source

Extract Images (any kind) from a ImageList and save it as a file with extension

Imagelist

Answer

Cody Gray picture Cody Gray · Mar 15, 2011

Have you already tried using the ExtractIcon method? That will return an IPictureDisp object representing an icon of the ListImage item.

Then, once you have extracted the picture object, you can simply call the SavePicture function to save it to a file on disk.

So you could use something like the following code:

Dim myPic As Picture
Set myPic = ImageList1.ListImages(1).ExtractIcon
SavePicture myPic, "C:\MyIcon.ico"  '(never hardcode a path in your actual code!)