Visual Studio图标看起来很糟 [英] Visual Studio icon looks bad

查看:169
本文介绍了Visual Studio图标看起来很糟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将应用程序图标添加到项目中,对其进行构建并为其创建快捷方式之后,我的应用程序图标看上去很糟糕.

I'm having trouble with my application icon looking bad after adding it into my project, building it, and creating a shortcut to it.

这就是我所做的:

1)我从一个看起来不错的256x256 PNG文件开始.

1) I started with a 256x256 PNG file that looks great.

2)我使用IcoFX生成了所有建议大小的.ICO文件.

2) I used IcoFX to generate a .ICO file with all the recommended sizes.

3)我将图标添加到我的项目中,如下所示: A)打开项目属性->资源->添加资源->添加现有文件 B)选择我在步骤2中创建的.ICO文件.

3) I add the icon to my project as follows: A) Open project properties -> Resources -> Add Resource -> Add Existing File B) Choose the .ICO file that I created in step 2.

4)转到项目属性的应用程序"部分.

4) Go to "Application" section of project properties.

5)在图标和清单"中,下拉图标",然后选择在步骤3中添加的图标.

5) In "Icon and Manifest", drop down "Icon" and choose the icon that I added in step 3.

6)保存我的项目并构建它.

6) Save my project and build it.

7)转到Windows资源管理器并找到新建的EXE.

7) Go to Windows Explorer and find the newly built EXE.

8)在桌面上创建EXE的快捷方式.

8) Create a shortcut to the EXE on the desktop.

图标如下所示:

如您所见,它看起来不太好.边缘呈锯齿状,等等.

As you can see, it doesn't look very good. The edges are jagged, etc.

起初,我认为我的.ICO文件存在问题,但这是问题所在……然后,我执行了以下操作:

At first, I thought it was an issue with my .ICO file, but here's the kicker... I then did the following:

9)右键单击桌面图标,然后转到属性".

9) Right-click on the desktop icon, and go to Properties.

10)转到快捷方式"标签,然后单击更改图标".

10) Go to the Shortcut tab and click "Change Icon".

11)单击浏览",然后选择在步骤3中添加到项目中的完全相同的图标文件.

11) Click "Browse", and select the EXACT SAME ICON FILE that I added to my project in step 3.

现在,我的桌面图标如下所示:

Now, my desktop icon looks like this:

现在,该图标看起来又漂亮又光滑!

Now, the icon looks pretty and smooth!

同样,两个图标都使用完全相同的.ICO源文件.唯一的区别是,第一个导入到Visual Studio中并嵌入到我的.EXE中,而另一个通过操作系统直接使用.

Again, both icons used the exact same source .ICO file. The only difference is that the first one was imported into Visual Studio and embedded in my .EXE, and the other one was directly used via the OS.

Visual Studio对我的图标做了什么处理,使其看起来如此肮脏,我该如何防止它出现?

What is Visual Studio doing to my icon to make it look so crummy, and how can I prevent it?

推荐答案

这可能是Windows图标缓存出现问题的原因.我遇到了与清除缓存相同的问题.

This could be a problem with the windows icon cache. I had the same problem that I fixed by clearing the cache.

您复制到桌面上的代码的第一个版本-此图标是否具有低分辨率图标? Windows将在第一次看到EXE时缓存该图标,然后即使它具有相同的文件名,即使您重建可执行文件,它也不会刷新.您还将在Windows资源管理器中看到相同的行为.

The first version of your code that you copied to the desktop - did this have a low res icon ? Windows will cache the icon when it first sees the EXE, and then does not refresh even when you rebuild your executable if it has the same filename. You will also see the same behavior in windows explorer.

我认为通过操作系统更改图标,您只是手动刷新了图标缓存.

I think by changing the icon through the OS, you've just manually refreshed the icon cache.

您可以在将EXE复制到桌面之前通过重命名EXE来快速进行测试.这将绕过缓存并在EXE中显示实际图标.

You can quickly test this by renaming the EXE before copying it to the desktop. This will bypass the cache and show the actual icon in your EXE.

要清除图标缓存中的所有旧图标,您可以按照此链接中的说明清除它

To get rid of any old icons in the icon cache, you can clear it as described in this link

http://www.winability.com /how-to-erase-icon-thumbnail-cache-windows-8/

这篇关于Visual Studio图标看起来很糟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆