BOOL
Cmfc_GDIDlg::OnEraseBkgnd(CDC* pDC)
{
CDC MemDC1;
CDC MemDC2;
MemDC1.CreateCompatibleDC(NULL);
MemDC2.CreateCompatibleDC(NULL);
CBitmap bitmap;
BITMAP BMInfo;
bitmap.LoadBitmapW(IDB_BITMAP1);
bitmap.GetBitmap(&BMInfo);
CRect rect;
GetClientRect(rect);
MemDC1.SelectObject(&bitmap);
CBitmap Membitmap;
Membitmap.CreateCompatibleBitmap(pDC,rect.Width(),rect.Height());
MemDC2.SelectObject(&Membitmap);
MemDC2.StretchBlt(0,0,rect.Width(),rect.Height(),&MemDC1,0,0,BMInfo.bmWidth ,BMInfo.bmHeight,SRCCOPY);
MemDC2.TextOutW(0,0,L
"我是固定文本"
);
pDC->BitBlt(0,0,rect.Width(),rect.Height(),&MemDC2,0,0,SRCCOPY);
pDC->TextOutW(100,100,L
"时间显示"
);
bitmap.DeleteObject();
MemDC1.DeleteDC();
MemDC2.DeleteDC();
return
true
;