如何实现一张大图缩小成一张小图,同时降低文件字节数。

解决方案 »

  1.   

    用StretchBlt api函数
    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.   

    好像delphi没有这个函数。
    有没有其他办法?我在的imageen组件没找到一个函数实现缩小图像并能够压缩字节。
    谁能再告诉我一下。
      谢谢!
      

  3.   

    上边两颗星的函数就可以实现你的要求,只要你的单元里uses windows即可,怎么会没有呢?
    要不,看看图像处理的资料吧,那里有放大,缩小的东西。