CPaintDC hdc(this);
HBITMAP bit;
BITMAP bitmap;
CRect rect;
GetClientRect(&rect);
bit= (HBITMAP) LoadImage (NULL,fic_img_abs,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);
GetObject(bit, sizeof(BITMAP), &bitmap);
int surf_width = bitmap.bmWidth;
int surf_height = bitmap.bmHeight;
HDC bit_dc = CreateCompatibleDC(hdc);
SelectObject(bit_dc, bit);
StretchBlt(hdc,0,0,rect.Width(),rect.Height(),bit_dc,0,0,bitmap.bmWidth,bitmap.bmHeight, SRCCOPY );
return true;
PS: je sais qu'il me manque une desallocation mais je trouve pas.
c'est un projet MFC , ceci est dans OnEraseBkgnd(CDC* pDC)
gege