This member function loads the bitmap resource named by lpszResourceName, or identified by the ID number in nIDResource, from the application's executable file. The loaded bitmap is attached to the CBitmap object.
BOOL LoadBitmap ( LPCTSTR lpszResourceName );
BOOL LoadBitmap ( UINT nIDResource );
Header File | Afxwin.h |
Platforms | |
Versions | 1.0 and later |
Complete documentation | Visual C++ documentation |
In Windows CE, when you initialize a CBitmap object by using the CBitmap::LoadBitmap member function, the bitmap is read-only. This is because Windows CE doesn't copy the bitmap into RAM, as Windows 95 and Windows NT do. In Windows CE, the bitmap only exists in a resource, which is part of the program's executable file. When you select the bitmap into a device context, you cannot modify the device context (for instance, by drawing text into it) because that would require the ability to write to the bitmap.
Windows CE does not support any predefined bitmaps, so you can not use any of the OBM_* values in the lpszResourceName parameter.
Windows CE 1.0 only supports a 2 bit gray scale palette so, in version 1.0, you can only use one bit per pixel (monochrome .bmp) or two bit per pixel (.2bp) bitmaps.
CBitmap Overview, CBitmap Member Functions, Graphical Drawing Object Classes, CBitmap::LoadOEMBitmap, CGdiObject::DeleteObject