也就是让图片框具有stretch的属性,使得图片自适应
图片框控件的大小,多谢!

解决方案 »

  1.   

    用StretchBlt
    只不过图像会变形失真,需要自己对位图进行处理.
      

  2.   

    相应控件的wm_size消息,在里面重新画一下就可以了
    GetClientRect,然后在DC里面画,一般不直接在dc里画,而是用CreateCompatibleDC创建一个dc,在这里画完后,在BitBlt到dc里面去
      

  3.   

    用gdi+ CDC* pDC=m_picHolder.GetWindowDC();
    CRect rc;
    m_picHolder.GetClientRect(&rc);
    rc.InflateRect(-10,-20,-20,-30);
    Rect dstRect(rc.left,rc.top,rc.right,rc.bottom);
    Graphics graphics(pDC->GetSafeHdc());
    Image imgJpg(m_lpstreamImage);
    graphics.DrawImage(&imgJpg,dstRect,0,0,imgJpg.GetWidth(),imgJpg.GetHeight(),UnitPixel);
    m_picHolder.ReleaseDC(pDC);
      

  4.   

    简单说一下使用gdi+的方法
    在stdafx.h加入
    #include "gdiplus.h"
    #pragma comment(lib,"gdiplus.lib");
    using namespace Gdiplus;在InitInstance中加入
    GdiplusStartupInput gdiplusStartupInput;

    GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
    在ExitInstance加入
    GdiplusShutdown(gdiplusToken);
    变量gdiplusToken是CXXXAPP的成员变量
    当然还有很多关于图形的操作,请查看msdn关于gdi+的帮助