flat assembler
Message board for the users of flat assembler.

Index > Windows > Win7 downgrades icon quality. What to do?

Author
Thread Post new topic Reply to topic
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
What am I doing wrong, or not doing?
Code:
section '.rsrc' data readable resource
directory RT_ICON,icons, RT_GROUP_ICON,group_icons
resource icons,\
           1,LANG_NEUTRAL,icon_data

resource group_icons,\
           2,LANG_NEUTRAL,main_icon

icon main_icon,icon_data,'icon.ico'
    


Original ico file is 32x32 and the compiled exe has 16x16.
Post 21 Dec 2011, 17:18
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1413
Location: Toronto, Canada
AsmGuru62
One solution is:
LoadImage + DrawIconEx. (instead of using resources)
Post 21 Dec 2011, 17:28
View user's profile Send private message Send e-mail Reply with quote
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
Do you mean the FASM resource handler is broken or not finished? Thanks for the help, I will try it. But I don't undertand resources at all. Gonna read up on that function.
Post 21 Dec 2011, 17:34
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1413
Location: Toronto, Canada
AsmGuru62
I believe, the issue is not in FASM - I had the same issues with C code. I had an icon with nice color depth and proper size, like 48x48, but the standard LoadIcon/DrawIcon pair was showing the 16 colors only at 32x32. The better way is to put images into some folder beside youe EXE file and load them on demand. This way youe EXE size will exactly reflect how much code you have written! Smile Otherwise, resources make your EXE fatter.
Post 21 Dec 2011, 17:54
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17473
Location: In your JS exploiting you and your system
revolution
You can store multiple resolutions of icons on the resources. You have to format the resources correctly though. By doing this you can allow programs like explorer to display high quality icons on the desktop. If you keep icons in separate files then you cannot support high quality icons for external programs to display your app (not to mention the headache of having to deal with multiple files during installation).
Post 21 Dec 2011, 18:13
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Use .res file instead of resource macros. ResHack is your friend here. Wink The last time I checked FASM resource macros was unable to load icons properly.
Post 21 Dec 2011, 19:07
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg
It may be true JohnFound, but funnily the error I experimented is probably because of a bug in win7. In the taskbar it doesn't show the actual icon, but an older one. Will ccleaner solve this? EDIT: Yes, it solved it. The actual good quality icon was there and everything was good with the exe, but first time when I compiled and ran the exe win7 decided to cache it forever Smile
It's called "Tray Notifications Cache"
Post 21 Dec 2011, 19:12
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
The .ico file may contain several icons with different resolutions and colors. Then Windows chooses one depending on its needs - for example 16x16 for small icons and details view and 32x32 for desktop view.
When there is only one image (even with good quality) Windows scales it to fit needed parameters. The result is poor in the most cases.
Post 21 Dec 2011, 21:29
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.