How to Crop Images without using Intent in Android

匿名 (未验证) 提交于 2019-12-03 02:49:01

问题:

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_CONTENT_URI); i.putExtra("crop", "true");
startActivityForResult(i, 1);

But i have to do crop image without using Intent. And also have to customize the croping UI. please help me out how to do that.

I am not supposed to use new Intent("com.android.camera.action.CROP");
with Thanks
Vikash

回答1:

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.



回答2:

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



回答3:

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(); 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!