int bmpWidth = 1600;
int bmpHeight = 500;
memDC.CreateCompatibleDC( &dc );
CBitmap * bitmap = new CBitmap();
bitmap->CreateCompatibleBitmap(&dc,bmpWidth, bmpHeight);
CBitmap * pOldBitmap = (CBitmap *) memDC.SelectObject( bitmap );
if (pOldBitmap == NULL) // if bitmap is very big, better check this !
{
memDC.DeleteDC();
delete bitmap;
AfxMessageBox("Not enough resource for the bitmap. Either reduce the bitmap dimension or
\nswitch to lower screen setting (e.g. 256-color mode), and try again.");
return;
}
//draw bitmap here, or it can be done in another function
memDC.Ellipse(0, 0, bmpWidth - 1, bmpHeight - 1);