基本对话框(dialog)面板上控件是固定的,现在有非常多的图片贴上去做美化,请问怎么讲JPG图片做背景呢?求详细教程,以前没用过怎么贴jpg。

解决方案 »

  1.   

    用ATL的CImageLoad JPEG。然后在CDialog的OnPaint,或者OnEreaseBackground里面。把Image draw上就可以了。
      

  2.   

    首先,你要是没有弄过GDI相关的,那确实很抽象,否则---一点都不抽象,你先把OnPaint弄出来,
    然后试着:
    http://www.cnblogs.com/juncheng/articles/1600730.html
      

  3.   

    看皮肤编程,或者你用免费的skin框架
      

  4.   

    那你先试试bmp做背景
    一步一步来吧
    http://blog.csdn.net/xianglitian/article/details/6023656
      

  5.   

    用画图板转成bmp的 再去弄
      

  6.   

    先用bmp格式的贴图吧
    设置对话框背景在OnPaint()添加代码CPaintDC dc(this); // device context for painting
    // TODO: Add your message handler code here
    // Do not call CDialog::OnPaint() for painting messages
    CRect   rect;   
        GetClientRect(&rect);   
        CDC   dcMem;   
        dcMem.CreateCompatibleDC(&dc);   
        CBitmap   bmpBackground;   
        bmpBackground.LoadBitmap(IDB_BITMAP1);    //IDB_BITMAP1你导入的背景位图
                   
        BITMAP   bitmap;   
        bmpBackground.GetBitmap(&bitmap);   
        CBitmap   *pbmpOld=dcMem.SelectObject(&bmpBackground);   
        dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0,   
        bitmap.bmWidth,bitmap.bmHeight,SRCCOPY);
    }