//在Onpaint函数中加入如下代码
//----------给窗口设置背景图片----------------------------
CPaintDC dc(this);
CRect myrect;
GetClientRect(&myrect);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap bmpBackground;
bmpBackground.LoadBitmap(IDB_BITMAP1); //IDB_BITMAP_TOOL是你自己的图对应的ID
BITMAP bitmap;
bmpBackground.GetBitmap(&
bitmap);
CBitmap *pbmpOld=dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(,,myrect.Width(),myrect.Height(),&dcMem,,,
bitmap.bmWidth,bitmap.bmHeight,SRCCOPY);
05-08 15:11