CBitmap myBitmap; myBitmap.LoadBitmap(IDB_MYBITMAP);
CBitmap myBitmap; myBitmap.CreateBitmap(100, 50, 1, 32, NULL);
CBitmap myBitmap; myBitmap.LoadBitmap(IDB_MYBITMAP); CDC* pDC = GetDC(); CDC memDC; memDC.CreateCompatibleDC(pDC); memDC.SelectObject(&myBitmap); pDC->BitBlt(0, 0, 100, 50, &memDC, 0, 0, SRCCOPY);This example loads a bitmap image from a resource (IDB_MYBITMAP) and displays it on a device context (pDC). The bitmap is first selected into a compatible device context (memDC) and then the BitBlt method is used to copy the bitmap to the target device context. The SRCCOPY parameter specifies the raster operation to use during the copy process. In conclusion, CBitmap is a class in the MFC library that provides support for bitmap images in Win32 applications. It is part of the MFC package library that comes with the Microsoft Visual C++ development environment.