【bug for plug in】往一个应用程序当中plug in menu的过程----第一节
来源:互联网 发布:个人能在淘宝开店吗 编辑:程序博客网 时间:2024/06/06 16:53
hbitmap是bitmap的指针,
msdn中:Handle to a bitmap.typedef HANDLE HBITMAP;
cbitmap是mfc中封装bitmap的类;
msdn中:Encapsulates(囊括) a Windows graphics device interface (GDI)bitmap and provides member functions to manipulate(操作) the bitmap.
class CBitmap : public CgdiObject
转化方法两种,Attach和FromHandle:
1 CBitmap bmp;
2 bmp.LoadBitmap(IDB_BITMAP1);
3 HBITMAP hbm = (HBITMAP)bmp;
4 CBitmap bmp1;
5 bmp1.Attach(hbm);
6
7 HBITMAP = CBitmap.m_hObject
8 CBitmap* = CBitmap.FromHandle(HBITMAP)
9
10 //已知HBITMAP hbit;
11 CBitmap cb;
12 cb.FromHandle(hbit);
13
14 //已知CBitmap cb;
15 HBITMAP hbit=(HBITMAP)cb;
16
17 CBitmap bmp;
18 HBITMAP hBmp;
19 //相互转换:
20 hBmp=(HBITMAP)bmp.GetSafeHandle();
21 bmp.Attach(hBmp);
注意点:
Attach和FromHandle的区别
FromHandle得到的指针是临时变量,
,通过Attach连接的句柄可以长久保留,但通过FromHandle得到的只是暂时的,
大概只在一个消息区间内有效,很快便会被删除,所以基本上不能用。
我用了FromHandle然后一直出错!!!
- 【bug for plug in】往一个应用程序当中plug in menu的过程----第一节
- plug-in
- Castor Plug-in for Eclipse
- NHibernate Plug-In for VS2005
- Eclipse Plug-in with a Popup Menu
- 【bug】plug in convert icon to bitmap
- Eclipse Plug-in的资料
- plug-in for eclipse 3X
- JADE Development Plug-in for Eclipse (EJADE)
- Add SVN plug-in for Carbide C++
- Open source audit plug-in for MySQL
- GNU ARM Eclipse Plug-in for Eclipse
- Build Eclipse plug-in for Hadoop
- install m2e plug-in for eclipse
- DataTables | Table plug-in for jQuery
- Unity3D Plug-in for Android -- Activity
- Android Plug-in for Gradle源码下载
- 建立一个 Plug-in with an editor
- Flex动态载入嵌入字体(Embeded Font)文件
- linux根文件系统的挂载过程 1
- 开始接触QT,一些感想
- 积累与跳槽
- Windows驱动编程基础教程
- 【bug for plug in】往一个应用程序当中plug in menu的过程----第一节
- 关于Android调用系统Action录制视频
- 流媒体
- 用VC++ 6.0来编译WDM驱动(限于2K DDK)
- 常量
- 对WinMain程序入口函数返回值为msg.wParam的几点理解
- Python MD5 验证
- 典型题例
- 嵌入式系统开发怎样快速度入门