Giter VIP home page Giter VIP logo

xxpicturecompress's Introduction

[TOC]

XXPictureCompres 使用方式

添加依赖

1.在project目录的build.gradle的allprojects节点添加 java maven { url "https://jitpack.io" } 如下:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

2.在自己Modul的build.gradle中添加compile 'compile 'com.github.luoshihai:XXPictureCompress:V1.0.0' 如下:

dependencies {
	compile 'com.github.luoshihai:XXPictureCompress:V1.0.0'
}

开始使用

1.第一个压缩方法:

//第一个参数表示压缩源 bitmap
//第二个参数表示压缩之后图片保存的路径
//第三个参数表示压缩后图片的最大的大小 单位为 Kb
	NativeUtil.compressBitmap(bmp, mCameraFilePath, 300);

2.第二个压缩方法:

//第一个参数表示压缩源 bitmap
//第二个参数表示压缩之后图片保存的路径
//第三个参数表示是否使用是否采用哈弗曼表数据计算 品质相差5-10倍
	NativeUtil.compressBitmap(bmp,mCameraFilePath,true);

OK,用起来就这么简单 效果要比安卓自带的压缩速度快 效果好太多倍

xxpicturecompress's People

Contributors

luoshihai avatar

Watchers

James Cloos avatar mick avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.