Sure.
CBitmap bm;
CDC memDC;
memDC.CreateCompatibleDC(pDC);
memDC.SelectObject(&bm);
for(int i=0;i<height;i++)
{
for(int k=0;k<widht;k++)
{
// memDC.SetPixel(i,k,RGB(...)) or memDC.BitBlt(.....)
}
}
First create a large bitmap and select to memeory dc,then use CDC.Setpixel()(for
small bitmaps such as icons ,cursors)or BitBlt() to copy several bitmaps to one
bitmap.