如何对JPEG文件进行压缩,不改变图像的长度及宽度,只调整其压缩率.
压缩后,生成的文件在 1024K 以内,但最接近 1024K.  (1024K只是一个例子,可以更小,比如:100K等,目的是让用户自己设定)目前100点,解决后另付300点.

解决方案 »

  1.   

    不可能吧,JPEG格式,本身就是压缩了的(JPEG无损压缩格式除外)不信你可以用RAR压压看少了多少??
      

  2.   

    楼上大概未理解楼主的意思,楼主的意思是想重新调整JPEG的压缩率。用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。
      

  3.   

    同意楼上!
    来晚了, 给你贴两断help吧. hehe-----------------------------------------------------Delphi syntax:procedure Compress;C++ syntax:void __fastcall Compress(void);DescriptionCall Compress to compress for optimization, such as before streaming out when assigning a bitmap to a jpeg. Changing properties like CompressionQuality does not force compression. To force compression, call Compress.---------------------------------------------------------------------Indicates the trade-off ratio between the image quality and the file size.Delphi syntax:property CompressionQuality: TJPEGQualityRange;C++ syntax:__property TJPEGQualityRange CompressionQuality = {read=FQuality, write=FQuality, nodefault};DescriptionUse CompressionQuality to set the compression quality of the JPEG image when writing out a jpeg image. Higher compression results in a poorer picture quality, but a smaller file size. This property is not used for reading in files. TJPEGQualityRange is the type of the CompressionQuality property. The higher the TJPEGQualityRange value (up to a maximum of 100), the better the image quality, but the larger the file size. The lower the TJPEGQualityRange value (to a minimum of 1), the smaller the resulting file size, but at the expense of picture quality.
      

  4.   

    补充: TJPEGQualityRange是1..100
      

  5.   

    用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。那么CompressionQuality设为多少合适呢?
      

  6.   

    首先要user jpeg;用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。
      

  7.   

    最一般的是75
    但最低也要25 否则失真太多请楼主自己看 <Visual C++ 实现MPEG/JPEG编解码技术> 一书里面有详细的源码 这里不帖了