本帖最后由 NesTa_xP 于 2011-07-03 18:34:46 编辑

解决方案 »

  1.   

    你这个pPictureCtrl是什么东西?你在SetBitmap前,应该将之前SetBitmap设置给它的HBITMAP尝试释放掉。
      

  2.   

    pPictureCtrl是一个CStatic* 用于显示图片用的MFC标准控件
      

  3.   

    HBITMAP SetBitmap( HBITMAP hBitmap );Return ValueThe handle of the bitmap previously associated with the static control, or NULL if no bitmap was associated with the static control.
      

  4.   


    谢谢,已解决CImage img; 
        HRESULT ret = img.Load(picture_path.c_str()); 
        HBITMAP bitmap = img.Detach(); 
        HBITMAP preBitmap = pPictureCtrl->SetBitmap(bitmap);
    if (preBitmap)
    {
    DeleteObject(preBitmap);
    }
    img.Destroy();
      

  5.   

    把pPictureCtr去掉还有吗,试试