How to Crop Images without using Intent in Android

前端 未结 3 418
遥遥无期
遥遥无期 2021-02-04 20:05

I am trying to crop an image I have used the code below

Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTE

3条回答
  •  佛祖请我去吃肉
    2021-02-04 20:52

    take a look at the following link. Should provide a good stepping stone to step up a ui with pinch to zoom and scroll and finally once you have what you want you can use a second view as your crop region. depends on what your looking for otherwise createBitmap option also works. http://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/

     View view = findViewById(R.id.crop_region);
     view.setDrawingCacheEnabled(true);
     view.buildDrawingCache();
     Bitmap cropBitmap = view.getDrawingCache();
    

提交回复
热议问题