CodePudding user response:
OnPaint in the DrawCodePudding user response:
Upstairs, the method of control or made the underlying backgroundCodePudding user response:
//loading pathChar path [MAX_PATH];
GetCurrentDirectory (MAX_PATH, path);
Cstrings filepath=path;
Filepath +=\ \ "res \ \ 1. JPG";
Image. The Load (filepath);//CImage image
//map
HBITMAP HBITMAP=image. Detach ();
CBitmap BMP.
BMP. Attach (hBitmap);
CRect the rect.
GetClientRect (& amp; The rect);
The CDC * PDC=this - & gt; GetDC ();
The CDC memdc;
Memdc. CreateCompatibleDC (PDC);
Memdc. SelectObject (& amp; BMP);
PDC - & gt; BitBlt (0, 0, the rect. Width (), the rect. Height (), & amp; Memdc, 0, 0, SRCCOPY);
Memdc. DeleteDC ();
BMP. DeleteObject ();