Home > Software engineering >  C questions about the program running background
C questions about the program running background

Time:10-21

O how c + + program run box background for a picture

CodePudding user response:

OnPaint in the Draw

CodePudding user response:

Upstairs, the method of control or made the underlying background

CodePudding user response:

//loading path
Char 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 ();
  • Related