How to Crop Images without using Intent in Android

前端 未结 3 403
遥遥无期
遥遥无期 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:34

    You can use createBitmap() to extract a subset of a current bitmap.

    0 讨论(0)
  • 2021-02-04 20:35

    Here is a sample project that Works same like Default Crop Intent of Android. CropImage If you really looking to try what you said,First look in to this link,Hope it may help you to find your way.

    0 讨论(0)
  • 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();
    
    0 讨论(0)
提交回复
热议问题