[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
CDC dcMem1; // memory DC for double buffering
bitmap1.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
CBitmap* pOldBitmap1 = dcMem1.SelectObject(&bitmap1);
// fill memory device context with the desired brush
CDC dcMem2; // memory DC for the bitmap to draw
CBitmap* pOldBitmap2 = dcMem2.SelectObject(&bitmap2);
int nWidth = bmp.bmWidth;
int nHeight = bmp.bmHeight;
int x = (rcClient.Width() / 2) - (nWidth / 2);
int y = (rcClient.Height() / 2) - (nHeight / 2);
// copy the bitmap in memory device context
dcMem1.BitBlt(x, y, nWidth, nHeight, &dcMem2, 0, 0, SRCCOPY);
nWidth = rcClip.Width();
nHeight = rcClip.Height();
x = rcClip.left;
y = rcClip.top;
// copy memory device context in client device context
dc.BitBlt(x, y, nWidth, nHeight, &dcMem1, x, y, SRCCOPY);
Open in new window
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.