直接在弹出的对话框中预览程序当前选定的位图,位图没有加载进程序中,只是选定的一个文件。thx先:~!

解决方案 »

  1.   

    重绘CFileDialog构造类
    m_ofn.Flags |= (OFN_EXPLORER | OFN_ENABLETEMPLATE);
    m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);http://shixie.topcities.com
      

  2.   

    知道你的意思了,   CDC * pDC = GetDC();
       HBITMAP bitmap1;
       /////读取位图文件sample.bmp
       bitmap1=(HBITMAP)LoadImage(AfxGetInstanceHandle(),"计算炉型.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
       ASSERT(bitmap1);
       HBITMAP oldbitmap;
       CDC memdc;CRect rect;
       memdc.CreateCompatibleDC(pDC);
       GetClientRect(rect);
       oldbitmap=(HBITMAP)memdc.SelectObject(bitmap1);
       ///显示它
       pDC->BitBlt(310,35,rect.Width()-20,rect.Height()-20,&memdc,0,0,SRCCOPY);
       memdc.SelectObject(oldbitmap);