读书人

LoadImage //LR_SHARED只对图标资源有

发布时间: 2013-01-06 15:44:48 作者: rapoo

LoadImage //LR_SHARED只对图标资源有效?
如题!!!!!! 用LoadImage加载位图资源, LR_SHARED有效吗?
[解决办法]
用LoadImage加载位图资源,LR_SHARED没效,每次的返回值都不一样
LoadImage加载Icon和Cursor,LR_SHARED才可能有效,但需要符合要求的:
1. 必须从资源加载,也就是不要有LR_LOADFROMFILE
2. 图像必须是标准的大小,如:16×16、32×32、48×48 ...

引用
Shares the image handle if the image is loaded multiple times. If LR_SHARED is not set, a second call to LoadImage for the same resource will load the image again and return a different handle.
When you use this flag, the system will destroy the resource when it is no longer needed.

Do not use LR_SHARED for images that have non-standard sizes, that may change after loading, or that are loaded from a file.

[解决办法]
这帖子把这问题解释的很清楚了

http://bbs.csdn.net/topics/390309446

读书人网 >VC/MFC

热点推荐