Reputation: 273
Does anybody knows how to use diferent icons sizes on delphi, I ask because the windows choose the best icon size when showing on explorer, But how do I put many icons in different sizes on resource.
Thanks again
Upvotes: 1
Views: 3683
Reputation: 612784
Here's how I do it:
$R
directive.I use these steps for all the icons that I use on toolbars and menus. That allows me to have a GUI that scales with the user's font scaling settings. The way that the Delphi IDE leads you to do it is to make a TImageList
and fill it up with icons that are stored in the .dfm file. That's pretty hopeless because it doesn't readily allow you to have different sized icons. And it also means that your visual assets are stored in a .dfm file in a great big glob representing all icons. If you want to swap out a single icon, then you can do so but it's rather opaque. The history trail left in your VCS is meaningless beyond any comments you leave.
If you are just talking about the main program icon, then you can add your .ico file to the project in the Project | Options | Application dialog and the IDE will take care of the rest of the details.
Upvotes: 11