java - ArthurHub 裁剪图像未转换为位图
问题描述
我目前在android studio(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();
}
}
解决方案
推荐阅读
- html - 阻止 iframe 重新加载
- apache-spark - 在 hive 表中生成前导值
- python - win32com excel缺少工作簿属性
- python - 如何在 for 循环中将一组参数传递给 PythonOperator() 中的 op_args?
- javascript - 使用 Dialogflow API 与机器人对话
- reactjs - Antd TimePicker 无法正确渲染
- database - MongoDB:列出用户名和他们收到的回复数量
- .net-5 - 容器没有响应端口:3000 上的 HTTP ping,
- sql - 如何避免在 XML AUTO 查询中嵌套
- mysql - SyntaxError:Flutter 中 JSON 输入的意外结束