图片压缩

来源:互联网 发布:程序员代码图 编辑:程序博客网 时间:2024/06/16 05:05
 Luban.get(this).load(file).putGear(Luban.THIRD_GEAR).setCompressListener(new OnCompressListener() {                @Override                public void onStart() {                    showLoading();                }                @Override                public void onSuccess(File file) {                    System.out.println("压缩成功");                    upLoadImage(file);                }                @Override                public void onError(Throwable e) {                    showLoadingSuccess();                    ToastUtil.showToast(PersonalInformationActivity.this,"图片错误",0);                }            }).launch();