从多图标 (.ico) 文件访问特定图标
我想知道以下是否可行。
我有一个 .ico 文件,包含多种尺寸和颜色深度。但是,它还包含一些定制尺寸,将在我的应用程序中使用。
应用程序通过资源 DLL 访问图标。 (目的是该 DLL 由第三方开发人员提供)
有没有办法准确指出 .ico 文件中的哪些图标要在我的应用程序中使用?就像我希望这个尺寸出现在我的 GUI 等上。
例如,我正在我的应用程序中制作一个按钮,我希望我的 .ico 文件中的自定义 15*32 图标显示在按钮上。
我知道可以通过一次将一个位图添加到资源 DLL 中,并为每个位图指定一个唯一的名称来实现这一点。
但如果我能够识别图标文件的不同内容,那就更容易了。
是否可以以某种方式将图标文件视为图标数组或类似的东西?
非常感谢任何帮助。在网上似乎很难找到有关此主题的信息。
哦,我正在用 C# 编写应用程序,使用 MFC DLL(从 Visual C++ 创建我的资源 DLL)
I would like to know if the following is possible.
I have an .ico file, containing several sizes and color depths. However, it also contains some custom made sizes, that are going to be used inside my application.
The application accesses the icon trough a resource DLL. (The intention is that the DLL is provided by a third party developer)
Is there any way to pinpoint exactly which of the icons in the .ico file to use in my application? Like I want this size to appear here on my GUI etc.
For instance, I am making a button in my application, and I would like my custom made 15*32 icon from my .ico file to be displayed on the button.
I know this is possible by adding the bitmaps one at a time to the resource DLL, giving each of them a unique name.
But it would be easier, if I am able to identify the different contents of the icon file instead.
Is it possible in some way to look at the icon file as an array of icons or something like that?
Any help is much appreciated. It seems quite hard to find information about this subject on the web.
Oh, and I am writing my application in C#, using MFC DLL (from Visual C++ to create my resource DLL)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我从 .ico 文件中获取精确大小的图像的方法。
This is how I get the exact-sized image from an .ico file.