这是一个简单的图片压缩工具(MCompressor),可自定义压缩的格式和质量,以及压缩后存储的文件路径,可决定对多大的文件进行压缩。

build.gradle文件

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

Android图片压缩工具MCompressor

Step 2. Add the dependency

Android图片压缩工具MCompressor

示例

最简单的使用方法,只需要添加原文件路径即可

Android图片压缩工具MCompressor

对大于500KB的文件进行压缩,压缩的文件格式为JPEG,压缩质量为80%,原文件路径为path,压缩文件保存路径可自定义

Android图片压缩工具MCompressor

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-05-27
  • 2021-12-08
  • 2021-06-19
猜你喜欢
  • 2021-07-27
  • 2022-02-09
  • 2022-12-23
  • 2021-05-03
  • 2021-11-27
  • 2021-07-23
  • 2022-02-09
相关资源
相似解决方案