Giter Club home page Giter Club logo

dwimageselector's Introduction

DWImageSelector

一个用于Android的图片选择库 三行代码就能实现图片选择(单选、多选<1-9张>,拍照<1张>)

第一步

compile 'com.ufo:DWImageSelector:0.9.5'

第二步:

图片选择:
DWImages.getImages(this, DWImages.ACTION_ALBUM, 6);
拍照选择:
DWImages.getImages(this, DWImages.ACTION_CAMERA, 1);

第三步:

结果获取:
  @Override
   protected void onActivityResult(int requestCode, int resultCode, Intent data) {
       super.onActivityResult(requestCode, resultCode, data);

        //就加上这行代码
       DWImages.parserResult(requestCode, data, new DWImages.GetImagesCallback() {
           @Override
           public void onResult(List<String> images) {
                //这里返回选择的图片路径
           }
       });
   }

进阶:

      若要对图片进行裁剪可以调用:
      DWImages.cropImage(this,onePath,4,5,400,500);

      同样在onActivityResult里添加:
      DWImages.parserCropResult(requestCode, data, new DWImages.CropImageCallback() {
                @Override
                public void onResult(String images) {
                    Log.d(TAG, "onResult:--> Crop path: " + images);
                    Log.d(TAG, "onResult:--> Crop size: " + new File(images).length());
                }
            });

具体更多操作,请看工程里的Demo,欢迎大家多多尝试,多挑毛病.

扫我安装体验Demo

dwimageselector's People

Contributors

123ufo avatar

Stargazers

 avatar DavidMc avatar  avatar  avatar  avatar jiangjj avatar wukai avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar N1eR avatar control_cv avatar regeorge avatar  avatar  avatar  avatar leguang avatar ShadowFiend avatar VV avatar liverloop avatar 抹杀你的浪漫 avatar Liam avatar xujiafeng avatar water avatar  avatar

Watchers

James Cloos avatar  avatar

dwimageselector's Issues

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.