001
15.11.2005, 14:37 Uhr
~Fredy Kruger
Gast
|
Hi,
versuch folgendes
BOOL CMyView::OnEraseBkgnd(CDC* pDC) { HBITMAP hBitmap = NULL; hBitmap = (HBITMAP)LoadImage(NULL, "Name des BMPs", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE); if (hBitmap) { CBitmap bmp; CDC memdc; BITMAP cbmp; CRect rect;
bmp.DeleteObject(); bmp.Attach(hBitmap); GetClientRect (&rect);
memdc.CreateCompatibleDC(pDC); memdc.SelectObject(&bmp);
int ret = bmp.GetBitmap(&cbmp); pDC->StretchBlt (0, 0, rect.Width(), rect.Height(), &memdc, 0, 0, cbmp.bmWidth, cbmp.bmHeight, SRCCOPY); }
return TRUE; }
Fredy Kruger |