Intent intent = new Intent("com.android.camera.action.CROP");
// this will open all images in the Galery
intent.setDataAndType(photoUri, "image/*");
intent.putExtra("crop", "true");
// this defines the aspect ration
intent.putExtra("aspectX", aspectY);
intent.putExtra("aspectY", aspectX);
// this defines the output bitmap size
intent.putExtra("outputX", sizeX);
intent.putExtra("outputY", xizeY);
// true to return a Bitmap, false to directly save the cropped iamge
intent.putExtra("return-data", false);
//save output image in uri
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
调用裁切图片
最新推荐文章于 2025-10-11 17:39:30 发布
本文介绍如何使用Android系统自带的图片裁剪功能。通过Intent设置不同的参数实现图片的裁剪操作,包括裁剪比例、输出大小等,并可以选择直接保存裁剪后的图片或将图片作为Bitmap返回。
861

被折叠的 条评论
为什么被折叠?



