Link to home
Create AccountLog in
Avatar of lomo74
lomo74Flag for Italy

asked on

delphi 2010 / Windows 7 / very large icons (>64 pixels)

Hello Experts,
has anyone succeeded in using Vista/7 very large icons in Delphi?
I'm using D2010 and cannot convince Explorer to show icons larger than 64 pixels.
I used the *same* .ico file (which was created with IcoFX and contains several icons, from 16x16 to 256x256 at various color depths) in a test project created with Visual Studio, a minimal exe doing nothing at all, and Explorer is showing large icons correctly.
I tried many solutions, besides loading the ico in the project's options:
- add ico to project directly (project, right mouse, Add..., select type "Resources" then add ico file);
- add an .rc file that recalls the .ico
- enabled / disabled runtime themes
- rebuilt icon cache using this procedure: http://www.vistax64.com/tutorials/117229-icon-cache-rebuild.html
Nothing seems to work. I'm afraid this is an Embarcadero linker limitation...

User generated image
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

Delphi stores the icon with the correct sizes. You can use XNResource Editor to verify that (Just open the .exe file and look at the MAINICON section).

When I change the folder view to large icons in Windows 7, it does show the icon properly
Avatar of lomo74

ASKER

this is what I see in XN resource editor if I open my Delphi exe.
 User generated image
Delphi has jammed my icon, as you can see.
If I try to open the other exe (the one compiled with Visual Studio), XN resource editor complains with the error message: "Pixel format not valid for icons or cursors".

Any idea?
I have trouble loading a 256x256 Icon

It may be that delphi has a maximum size that it can use as the program icon (I was able to use up to 64x64 with no problem)

(I also see that it shows width=0 and Height=0 which means it will just default to a "norma size" ie 16x16)
ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of lomo74

ASKER

=:-O

Geert: awesome - I wonder how he did it, the guy must be a piece of a genius!
Fix Delphi bugs at runtime in memory... ha ha
many thanks for the tip --