那位有这方面的代码我在网上找了  不是不显示
就是运行有问题 哎 那位帮下忙啊  
搞了一下午了 我用是的VC  image  

解决方案 »

  1.   

     HBITMAP   hBitmap=(HBITMAP)LoadImage(NULL,"D:\工作\35345634534   \res\1.bmp",0,0,0,LR_CREATEDIBSECTION|LR_DEFAULTSIZE|LR_LOADFROMFILE);   
      CBitmap   m_mybit;   
      m_mybit.Attach(hBitmap);   
      CPaintDC dc(this);   //   device   context   for   painting   
      CDC dcBmp;   
      CRect r;   
      GetClientRect(&r);   
      dcBmp.CreateCompatibleDC((CDC*)&dc);   
      dcBmp.SelectObject(m_mybit);   
      dc.BitBlt(r.left, r.top, r.right-r.left,r.bottom - r.top, &dcBmp, 0, 0, SRCCOPY);
    也就了这个 不什么用 哎
      

  2.   

    你说的Image是指什么?可以用LoadImage动态加载图片。
      

  3.   

    恩 我以前也是 Image 后来发现动态加载, 更新太慢, 后来用了带图片的按钮才实现了快速地动态更新.
      

  4.   

    "D:\\工作\\35345634534\\res\\1.bmp"我还以为是别人回复的,没注意看。
      

  5.   

    直接用CImage类多好,很方便。
      

  6.   

    给你一段显示图片的示例:// This OnDraw() handler loads a bitmap from system resources, centers 
    // it in the view, and uses BitBlt to paint the bitmap bits.void CBlat2View::OnDraw(CDC* pDC)
    {
      CBlat2Doc* pDoc = GetDocument();
      ASSERT_VALID(pDoc);  // Load IDB_BITMAP1 from the resources.
      CBitmap bmp;
      if (bmp.LoadBitmap(IDB_BITMAP1))
      {
        // Get the size of the bitmap.
        BITMAP bmpInfo;
        bmp.GetBitmap(&bmpInfo);    // Create an in-memory device context compatible with the
        // display device context that is used to paint.
        CDC dcMemory;
        dcMemory.CreateCompatibleDC(pDC);    // Select the bitmap into the in-memory device context.
        CBitmap* pOldBitmap = dcMemory.SelectObject(&bmp);    // Find a center point for the bitmap in the client area.
        CRect rect;
        GetClientRect(&rect);
        int nX = rect.left + (rect.Width() - bmpInfo.bmWidth) / 2;
        int nY = rect.top + (rect.Height() - bmpInfo.bmHeight) / 2;    // Copy the bits from the in-memory device context to the on-
        // screen device context to do the painting. Use the computed center 
        // point for the target offset.
        pDC->BitBlt(nX, nY, bmpInfo.bmWidth, bmpInfo.bmHeight, &dcMemory, 
          0, 0, SRCCOPY);    dcMemory.SelectObject(pOldBitmap);
      }
      else
        TRACE0("ERROR: Where is IDB_BITMAP1?\n");
    }
      

  7.   

    个人推荐使用GDI+。方便多了。
      

  8.   

    也可以使用 IPicture 接口。
    Simple class for drawing pictures (JPG, TIFF, GIF, etc...)
    http://www.codeproject.com/KB/graphics/cpicture.aspx