首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

LoadImage //LR_SHARED只对图标资源有效?解决办法

2013-01-06 
LoadImage //LR_SHARED只对图标资源有效?如题!!!!!! 用LoadImage加载位图资源, LR_SHARED有效吗?[解决办法

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

热点排行