Extract I开发者_StackOverflowmages (any kind) from a ImageList and save it as a file with extension
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!)
I think this is what you want: http://btmtz.mvps.org/gfxfromfrx/
I found pretty handy.
精彩评论