Link to home
Start Free TrialLog in
Avatar of MonkeyLin
MonkeyLin

asked on

How to extract an icon resouurce file from a exe,icl or dll file,and saves it as an ico file?(Do not use Ticon))

TIcon only saves icon as a 16 color ico file,but I want to get a unabridged ico file(a icon file that includes lots style of icon) from these files(exe,icl,dll),what should I do? Thanks!
An Icon file, which usually has the ICO extension, contains one icon resource. Icon resource can also be stored in .DLL and .EXE files. And an icon resource can contain multiple images, like 16*16*256 colors,32*32*true  colors,48*48*16 colors... I want to save all of the images into an icon file.
Avatar of soapsiam
soapsiam

There are API functions that can be used to extract icon from exe and dll. The ExtractIcon function retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file. You can also use functions in Resource Functions Group e.g. enumresourcetype, loadresource. Please see the win32 API help included with Delphi. Example of code also available at http://delphi.about.com

hello MonkeyLin, what do you need? a way to save 256 color icons to file? It's true that Delphi Icons only save in 256 colors. I don't understand when you said - "I want to get a unabridged ico file(a icon file that includes lots style of icon)". Do you just mean 256 colors, what other styles does an Icon have?
Avatar of MonkeyLin

ASKER

An Icon file, which usually has the ICO extension, contains one icon resource. Icon resource can also be stored in .DLL and .EXE files. And an icon resource can contain multiple images, like 16*16*256 colors,32*32*true  colors,48*48*16 colors... I want to save all of the images into a icon file.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_248744
Member_2_248744
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think it's helpful.
Thank you! ^-^