void CTest1Dlg::OnButton1() 
{
// TODO: Add your control notification handler code here
CClientDC dc(this); CBitmap   bitmap; 
bitmap.LoadBitmap(IDB_BITMAP1);     //加载位图  BITMAP   bitmap1; 
bitmap.GetBitmap(&bitmap1);             //用位图的信息来填充BITMAP结构体。  CDC   compatible; 
compatible.CreateCompatibleDC(&dc);//创建兼容DC 
                            
compatible.SelectObject(&bitmap);//把加载的位图选择进兼容DC中。  CRect   rect; 
GetWindowRect(&rect);                         //获取窗体对话框(目标DC)中的矩形区域。  dc.BitBlt(0, 0, rect.right - rect.left, rect.bottom - rect.top, &compatible, 0, 0, SRCCOPY );//把位图粘贴到对话框中。
}