Salut.
j'ai d�velopp� une application sous visual C++ mais je n'arrive pas � afficher une image en fond d'�cran.
Ma fonction est :
et cette fonction est appell�e dans
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 void CMainFrame::ImageFond(CDC* pDC) { CBitmap bmp; CBitmap *ptrBmpOld; CDC dcMemory; BITMAP bm; CRect rect; Invalidate(TRUE); bmp.LoadBitmap(IDB_IMAGE_LARGE); bmp.GetBitmap(&bm); GetClientRect(rect); dcMemory.CreateCompatibleDC(pDC); ptrBmpOld=dcMemory.SelectObject(&bmp); pDC->StretchBlt(0,0,rect.Width(),rect.Height(),&dcMemory,0,0,(bm.bmWidth),(bm.bmHeight), SRCCOPY ); dcMemory.SelectObject(ptrBmpOld); }
Mon image s'affiche
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5 BOOL CMainFrame::OnEraseBkgnd(CDC* pDC) { ImageFond(pDC); return TRUE; }mais couvre la barre des taches
ainsi que les autres fenetres
. Et lorsque je d�place la fenetre d'application mon image disparait
.
Je n'arrive pas � voir d'o� cela vient.
Y aurait il d'autres param�tres � r�gler dans mon application pour avoir une jolie image en font d'�cran ?
Merci pour votre aide![]()
A+
Partager