我目前在androidstudio(java)中使用arthurhub作为图像裁剪器,我想将裁剪后的图像转换为位图,但是当我运行它时,一旦完成裁剪,它就会突然崩溃。我希望有人能解决这个问题。谢谢您。
代码如下:
if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
CropImage.ActivityResult result = CropImage.getActivityResult(data);
if (resultCode == RESULT_OK) {
Uri resultUri = result.getUri();
ImageView imageResult = findViewById(R.id.imageView1);
imageResult.setImageURI(resultUri);
bundle = data.getExtras();
Bitmap bitmap = (Bitmap) bundle.get("data");
imageResult.setImageBitmap(bitmap);
} else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
Exception error = result.getError();
}
}
暂无答案!
目前还没有任何答案,快来回答吧!