如何将 wxIcon 添加到我的框架应用程序?
我查遍了整个网络,似乎找不到在我的 wxWidgets 应用程序中包含 wxIcon 的标准方法,该方法确实有效!我尝试过将图标转换为 XPM,包括我也尝试过加载位图,但无论我做什么,它似乎都能编译,但图标从未出现!
I've looked all over the net and can't seem to find a standard way of including a wxIcon in my wxWidgets app that actually works! I've tried converting the icon to an XPM and including that I've also tried loading the bitmap but whatever I do it seems to compile but the icon never appears!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在 Windows 上尝试此操作,请确保图标为 32x32 像素。所有其他尺寸根本没有被渲染......
If you are trying this on Windows make sure the icon is 32x32 pixels. All other sizes weren't being rendered at all...
这是您在这里讨论的应用程序的主图标吗?如果是这样,您只需将其作为 .rc 文件中的第一个图标资源,例如:
另一方面,如果您专门在其他框架上设置图标,那么只需设置它就足够了通过
wxTopLevelWindow::SetIcon
。如果这些都不起作用,也许您可以发布不起作用的代码示例?
Is this the main icon for your application that you're talking about here? If so, you just need to have it as the first icon resource in your .rc file, e.g.:
If, on the other hand, you're setting an icon specifically on some other frame, then it should be enough to just set it via
wxTopLevelWindow::SetIcon
.If neither of these works, perhaps you could post a sample of your code that isn't working?