AutoHotkey Community

It is currently May 27th, 2012, 12:01 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: November 28th, 2005, 7:48 am 
Offline

Joined: July 20th, 2005, 4:49 am
Posts: 65
When loading Icons from exe files ahk only seems to do the right thing for icons sized 32x32.

For Example

Firefox.exe has 3 icons embedded within it.

Icon1 contains 9 formats
1. 48x48 32 bit alpha transparency
2. 32x32 32 bit alpha transparency
3. 16x16 32 bit alpha transparency
4. 48x48 256 color default transparency
5. 32x32 256 color default transparency
6. 16x16 256 color default transparency
7. 48x48 16 color default transparency
8. 32x32 16 color default transparency
9. 16x16 16 color default transparency

Icon2 contains 6 formats - I won't list them as they are not relevant
Icon3 contains 9 formats - an exact duplicate of Icon1 (not sure why they included this)

Following is the outcome for different gui loading options

Gui, Add, Pic, w32 h32, firefox.exe
Produces a 32x32 alpha transparency icon: OK

Gui, Add, Pic, w32 h32 Icon1, firefox.exe
Produces a 32x32 alpha transparency icon: OK

Gui, Add, Pic,, firefox.exe
Produces a 32x32 alpha transparency icon: OK

Gui, Add, Pic,Icon1, firefox.exe
Produces a 32x32 alpha transparency icon: OK

Gui, Add, Pic, w48 h48, firefox.exe
Stretches the 32x32 icon to 48x48 and uses alpha transparency: Should use 48x48 embedded Icon

Gui, Add, Pic, w48 h48 Icon1, firefox.exe
Stretches the 32x32 icon to 48x48 and uses alpha transparency: Should use 48x48 embedded Icon

Similar problems occur with other sizes even though a matching icon size exists. Actually It's difficult to tell what ahk does with a 16x16 icon.

Compare this to extracting an Icon from the exe and saving it as an ico file. In this case, all icons are
rendered correctly and no stretching is performed.

I can provide some screenshots if that would help.

This problem doesn't seem to me to be related to the note in the Help about using a different icon loading method if an Icon Number is specified - but maybe I've misunderstood.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 28th, 2005, 3:30 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I think this is normal behavior within the limits of the current design. This is because the icon number is the number of the icon group within the file. Since each group can contain multiple icons, the program can get only the default icon from the specified group.

There is an item on the to-do list to offer the ability to specify an icon's size and/or color depth to override this behavior. In the meantime, one work-around is to extract the individual icon out of the file and save it individually to a .ico file (this can be done with tools such as LiquidIcon). Then have the script load from that .ico file.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 25 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group