如题在VC单文档的View框架里 显示一张位图并且可以实现位图的放大缩小真心求教希望大家给一些建议分不够再给

解决方案 »

  1.   

    The StretchBlt function copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary. The system stretches or compresses the bitmap according to the stretching mode currently set in the destination device context. BOOL StretchBlt(
      HDC hdcDest,      // handle to destination DC
      int nXOriginDest, // x-coord of destination upper-left corner
      int nYOriginDest, // y-coord of destination upper-left corner
      int nWidthDest,   // width of destination rectangle
      int nHeightDest,  // height of destination rectangle
      HDC hdcSrc,       // handle to source DC
      int nXOriginSrc,  // x-coord of source upper-left corner
      int nYOriginSrc,  // y-coord of source upper-left corner
      int nWidthSrc,    // width of source rectangle
      int nHeightSrc,   // height of source rectangle
      DWORD dwRop       // raster operation code
    );
      

  2.   

    CDC::StretchBlt Copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap if necessary to fit the dimensions of the destination rectangle. 
    BOOL StretchBlt(
       int x,
       int y,
       int nWidth,
       int nHeight,
       CDC* pSrcDC,
       int xSrc,
       int ySrc,
       int nSrcWidth,
       int nSrcHeight,
       DWORD dwRop 
    );
     
    CImage::StretchBlt 
    Copies a bitmap from the source device context to this current device context. 
    BOOL StretchBlt(
       HDC hDestDC,
       int xDest,
       int yDest,
       int nDestWidth,
       int nDestHeight,
       DWORD dwROP = SRCCOPY 
    ) const throw( );
    BOOL StretchBlt(
       HDC hDestDC,
       const RECT& rectDest,
       DWORD dwROP = SRCCOPY 
    ) const throw( );
    BOOL StretchBlt(
       HDC hDestDC,
       int xDest,
       int yDest,
       int nDestWidth,
       int nDestHeight,
       int xSrc,
       int ySrc,
       int nSrcWidth,
       int nSrcHeight,
       DWORD dwROP = SRCCOPY 
    ) const throw( );
    BOOL StretchBlt(
       HDC hDestDC,
       const RECT& rectDest,
       const RECT& rectSrc,
       DWORD dwROP = SRCCOPY 
    ) const throw( );
     
    更多详细内容请参考MSDN。
      

  3.   

    1。可以使用StretchBlt 
    2.也可以使用GDI+
      

  4.   

    也可通过调整映射模式,如
    SetMapMode(MM_ISOTROPIC)
      

  5.   

    StretchBlt()可以实现缩放;
    当然也可以自己写个缩放程序,如果是缩小一倍,对原图像隔行隔列取点,如果放大一倍,则原来一个点变成2*2的四个点
      

  6.   

    加这个平滑显示,要不然效果很艺术
    SetStretchMode(HALFTONE)
      

  7.   

    插值饱和,再平滑滤波一下
    要不就调一堆API,看你程序要求如何~~~