文件时在通过CFILEDialog读取的, 刚开始的尺寸比我的Picture Control的大, 
我想让刚开始的时候,就将这个大尺寸的图片显示在我的picture control,是全部显示, 也就是缩放显示,
应该怎么做?

解决方案 »

  1.   

    获得picture控件的的RECT,然后用StretchBlt函数进行绘图
      

  2.   

    用CDC中的这个函数可以解决缩放显示的问题。
    BOOL StretchBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC,
    int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop);
    GDIPLUS中有这个函数也可以(还有几个其它的也行,个人认为这个比较好用)
    另外我认为更好用的一个是 
    Status DrawImage(          Image *image, 
        const RectF &destRect, 
        REAL srcx, 
        REAL srcy, 
        REAL srcwidth, 
        REAL srcheight, 
        Unit srcUnit, 
        ImageAttributes *imageAttributes, 
        DrawImageAbort callback, 
        VOID *callbackData 
    ); 这两个解决没有问题。给分吧!