返回> 网站首页 

对话框全屏显示背景图片

yoours2007-04-20 20:12:02 阅读 1036

简介一边听听音乐,一边写写文章。

 int m_ncxScreen = GetSystemMetrics(SM_CXSCREEN);
    int m_ncyScreen = GetSystemMetrics(SM_CYSCREEN);
    //Set this window's size to full screen
// SetWindowPos( &wndTopMost , 0 , 0 , m_ncxScreen , m_ncyScreen , SWP_SHOWWINDOW);
    HBITMAP m_hbkBitmap = (HBITMAP)::LoadImage( NULL , "D:\\5000.bmp", IMAGE_BITMAP ,0 , 0 , LR_LOADFROMFILE);
    CDC *pDC = GetDC();
 CDC m_dcMem;
 CBitmap m_bmMem;
    m_dcMem.CreateCompatibleDC(pDC);
    m_bmMem.Attach(m_hbkBitmap);
    m_dcMem.SelectObject(m_bmMem);
 BITMAP bm;
    m_bmMem.GetBitmap(&bm);
    CRect rc;
    GetClientRect(&rc);
    pDC->SetStretchBltMode(COLORONCOLOR);
    pDC->StretchBlt( rc.left , rc.top , rc.Width() , rc.Height() , &m_dcMem , 0 , 0 , bm.bmWidth , bm.bmHeight , SRCCOPY);//SRCCOPY
微信小程序扫码登陆

文章评论

1036人参与,0条评论