1 静态加载,定义资源IDB_BITMAP1 BITMAP 相对路径 2 动态加载,用::LoadImage()API然后CBitmap::Attach()即可 LoadBitmap是从EXE、DLL文件中加载,不是从硬盘加载! DrawPicture(hwnd){PAINTSTRUCT ps;HDC hdc;HDC hdcmem; HBITMAP hBm;BITMAP bm;//hBm=::LoadBitmap(NULL,D:\\Test.bmp); //hBm=::LoadBitmap(IDB_BITMAP1); // hBm=::LoadBitmap(D:\\Test.bmp); //HINSTANCE hInst=GetModuleHandle(this); hBm = (HBITMAP)LoadImage(NULL,d:\\Test.bmp,IMAGE_BITMAP,640,480,LR_LOADFROMFILE); //hBm=::LoadBitmap(GetModuleHandle(this),MAKEINTRESOURCE(IDB_BITMAP1)); //获取位图尺寸