CBitmap bitmap; bitmap.Alloc(100, 100, 24); // allocate a 100x100 RGB bitmap
CBitmap bitmap; CClientDC dc(this); bitmap.AllocCompatibleBitmap(&dc, 100, 100); // allocate a bitmap compatible with the device contextIn this example, we create a new CBitmap object and allocate memory for a 100x100 bitmap that is compatible with the device context of a custom control. This bitmap could be used for custom drawing operations in the control. Package library: Microsoft Foundation Class (MFC) library.