在 Windows 上切换任务时,如何设置显示在 Alt-Tab 对话框中的应用程序图标?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4310341/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to setup application icon that shows up in Alt-Tab dialog when switching tasks on Windows?
提问by stefanB
How do I setup icon, for wxpython
application on Windows
, that shows up in the Alt-Tab
dialog when I'm switching between applications?
我如何为wxpython
应用程序设置图标,当我在应用程序之间切换时Windows
显示在Alt-Tab
对话框中?
The application icon in the menu bar and the corner of the running app shows my icon but when I switch between applications using Alt-Tab I can see the default square with blue outline icon.
菜单栏中的应用程序图标和正在运行的应用程序的角落显示我的图标,但是当我使用 Alt-Tab 在应用程序之间切换时,我可以看到带有蓝色轮廓图标的默认方块。
Do I need to do something extra for my icon to show up in Alt-Tab dialog or does my icon have to include a special resolution?
我是否需要为我的图标在 Alt-Tab 对话框中显示做一些额外的事情,还是我的图标必须包含一个特殊的分辨率?
In my class initializer I setup icon :
在我的班级初始化程序中,我设置了图标:
class A(wx.Frame):
def __init__(self,parent,id,title):
wx.Frame.__init__(self,parent,-1,title,size=(265,434))
favicon = wx.Icon('C:\source\python\gui\gf.ico',
wx.BITMAP_TYPE_ICO, 16,16)
wx.Frame.SetIcon(self,favicon)
回答by gaefan
This works for me:
这对我有用:
self.icon = wx.Icon(fn, wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
where the icon in fn has several resolutions (16, 32, and 48, I think).
fn 中的图标有多种分辨率(我认为是 16、32 和 48)。
Looks like you at least want to change
看起来你至少想要改变
wx.Frame.SetIcon(self,favicon)
to
到
self.SetIcon(favicon)
Also, try removing the 16's from the wx.Icon call and making sure your icon has other resolutions.
另外,尝试从 wx.Icon 调用中删除 16 并确保您的图标具有其他分辨率。