【问题标题】:Why is the incorrect icon being displayed?为什么显示不正确的图标?
【发布时间】:2014-12-18 21:29:49
【问题描述】:

为什么显示不正确的图标?

采取的步骤:

1) 右键单击​​项目 => 属性 => 应用程序(左侧菜单)=> 资源(组框)=> 图标和清单(单选按钮)=> 浏览到 \Resources ... 选择 IconHome.ico 文件已创建。

2) 修改xaml代码

<Window x:Class="HomeDb.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Home" Icon="IconHome.ico">

显示的图标不是“16x16 4 位”。显示的图标类似于“16x16 8 位”。

我还注意到使用 Windows 资源管理器查看图标时,图标看起来不像已创建,除非我打开 .ico 文件。然后它正确显示。这是 Windows 7 的问题吗?

【问题讨论】:

    标签: c# xaml icons


    【解决方案1】:

    哇。这真的很微妙。

    在我的其他图标下方显示“32x32 8 位”、“16x16 8 位”、“32x32 32 位”和“16x16 32 位”图标。

    我不得不:

    1) 删除那些多余的图标...右键单击 => 删除图像类型。

    2) 重命名图标(Visual Studio 需要)。

    3) 右键单击​​项目 => 属性 => 应用程序(左侧菜单)=> 资源(组框)=> 图标和清单(单选按钮)=> 浏览到 \Resources ... 选择 IconHomeNew.ico 文件已创建。

    4) 修改xaml代码

    <Window x:Class="HomeDb.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Home" Icon="IconHomeNew.ico">
    

    5) 在 Resources.resx 中将 IconHome.ico 重命名为 IconHomeNew.ico。

    现在可以了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多