Home > Software engineering >  How to realize the use change file paths dialog background?
How to realize the use change file paths dialog background?

Time:12-13

 

CPaintDC dc (this);
CRect the rect.
GetClientRect (& amp; The rect);//get the client's size;
CBitmap bmpBackground;

HBITMAP HBITMAP;
HBitMap=(hBitMap) LoadImage (AfxGetInstanceHandle (), _T (" Bitmap \ 464. BMP "), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);

//HBITMAP HBITMAP=(HBITMAP) : : LoadImage (NULL, _T (" Bitmap \ \ 464. BMP "), IMAGE_BITMAP, 110, 0, LR_LOADFROMFILE);//this tried, also not line, and one of the world, is unable to assignment, hBitMap hBitMap==NULL, path to ensure no problem, I come from the VS bitmap resources assignment of
If (hBitMap==NULL)
{
MessageBox (L "loaded bitmap failure");
return;
}
BmpBackground. Attach (hBitMap);
BITMAP BITMAP.
BmpBackground. GetObject (sizeof (bitmap), & amp; Bitmap);//get the bitmap information

The CDC dcMem.
DcMem. CreateCompatibleDC (& amp; Dc);//creates a memory DC;
CBitmap * pbmpOld=dcMem. SelectObject (& amp; BmpBackground);//select a bitmap to be loaded into memory device context.

Dc. StretchBlt (0, 0, the rect. Width (), the rect. Height (), & amp; DcMem, 0, 0, bitmap bmWidth, bitmap. BmHeight, SRCCOPY);

DcMem. SelectObject (pbmpOld);//the original bitmap reload the
DcMem. DeleteDC ();


Stop in this for a long time, leaders help to have a look
  • Related