WPF不同的窗口图标和任务栏图标 [英] WPF different Window Icon & Taskbar Icon

查看:99
本文介绍了WPF不同的窗口图标和任务栏图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WPF中,窗口和任务栏是否可以具有不同的图标.在我的特殊情况下,我想为窗口提供一个具有透明性的图标,并为任务栏提供一个"Metro"样式(带有彩色背景).

Is it possible in WPF to have a different Icon for the Window and the Taskbar. In my special scenario I want to have a an Icon with transparency for the Window and one "Metro" Style (with colored Background) for the Taskbar.

将Application-Icon设置为其他操作无效,任务栏始终显示窗口图标.

Setting the Application-Icon different didn't work, Taskbar always shows the Window Icon.

任何人都可以提供解决方案吗?

Anybody can offer a solution?

推荐答案

由于窗口"图标始终为16px,并且任务栏中的图标"较大(我不知道使用的是哪种大小,但我猜是32x32),您可以制作一个内容不同,大小不同的图标.

Since the Window icon always is 16px, and the Icon in the taskbar is larger (I don't know which size is used, but I would guess 32x32), you can make an icon which has different content for different sizes.

标准图标通常为64x64或48x48,并按其余尺寸缩小.相反,如果您创建一个带有彩色背景的48x48图标和一个没有背景的16x16图标,则您的应用将使用16x图标作为窗口图标,而48x图标作为任务栏.

A standard icon is usually 64x64 or 48x48, and scaled down for the rest of the sizes. If you instead create one 48x48 icon, with a colored background, and one 16x16 icon with no background, your app will use the 16x icon for the window icon, and the 48x icon for the taskbar.

这篇关于WPF不同的窗口图标和任务栏图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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