grp7

 

Export BMP File To Icon File


Export BMP File To Icon File

With the code below you can save BMP file as ICO File.


Preparations

Add 1 ImageList Control to your form.


Form Code

Private Sub Form_Load()
' Load the picture into the ImageList. replace "d:\myDir\File.bmp"
' with the BMP file name you want to export.
ImageList1.ListImages.Add , , LoadPicture("d:\myDir\File.bmp")
' Save the icon file. replace "d:\myDir2\File2.ico" with the new Icon
' file you want to create.
SavePicture ImageList1.ListImages(1).ExtractIcon,
"d:\myDir2\File2.ico"
End Sub