资 源 简 介
一种向CBitmap对象读取“*.bmp”文件的快捷方式。
1、建立自己的CBitmap派生类。
2、增加一个“Load from bitmap”的函数:
BOOL CMyBitmap::LoadBitmap(LPCTSTR szFileName)
{
DeleteObject()
HBITMAP hBitmap=NULL
hBitmap=(HBITMAP)LoadImage(NULL,szFileName,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION|LR_DEFAULTSIZE)
return Attach(hBitmap)
}-CBitmap object to a reading of "*. bmp" file shortcuts. One, to build their own CBitmap derived class. 2, add a "Load from bitmap" function : BOOL CMyBitmap : : LoadBitmap (LPCTSTR szFileName) (DeleteObje ct () HBITMAP hBitmap = NULL hBitmap = (HBITMAP) LoadImage (NULL, szFileName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_D EFAULTSIZE) return Attach (hBitmap);)