// 进入图片裁剪页面
public static Intent getTakePickIntent(File file) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE, null);
intent.putExtra(MediaStore.ACTION_IMAGE_CAPTURE, Uri.fromFile(file));
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
return intent;
}
public static Intent getImageClipIntent(Bitmap bitmap) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
intent.setType("image/*");
if (bitmap != null) {
intent.putExtra("data", bitmap);
}
intent.putExtra("crop", "false");
// if (optionType != 3) {
intent.putExtra("aspectX", 1);// 裁剪框比例
intent.putExtra("aspectY", 1);
// }
intent.putExtra("return-data", true);
return intent;
}
调用系统裁切功能裁切图片
最新推荐文章于 2021-03-20 10:58:39 发布