Lazarus中文社区

 找回密码
 立即注册(注册审核可向QQ群索取)

QQ登录

只需一步,快速开始

版权申明
查看: 2599|回复: 0

怎么高质量压缩图片

[复制链接]

该用户从未签到

发表于 2015-5-6 23:21:07 | 显示全部楼层 |阅读模式
  1. DescImage:= TBitmap.Create;
  2. SaveImage:= TPicture.Create;
  3. try
  4.     DescImage.Width:= Width;
  5.     DescImage.Height:= Height;
  6.     DescImage.Canvas.StretchDraw(Rect(0, 0, Width, Height), SourceImage.Graphic);
  7.     SaveImage.Assign(DescImage);
  8.     SaveImage.FindGraphicClassWithFileExt('jpg');
  9.     SaveImage.SaveToFile(DescFileName);
  10. finally
  11.     DescImage.Free;
  12.     SaveImage.Free;
  13. end;
复制代码
Lazarus 做一个压缩图片的代码,压缩出来的图像损耗很大,完全比不上其他软件做出来的样子。

不要发 Delphi 的代码,我用 GDI+ 做过。
回复

使用道具 举报

*滑块验证:

本版积分规则

QQ|手机版|小黑屋|Lazarus中国|Lazarus中文社区 ( 鄂ICP备16006501号-1 )

GMT+8, 2025-5-2 12:46 , Processed in 0.026342 second(s), 10 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表