![](/img/trans.png)
[英]How to save cropped image in android instead of returning cropping data?
[英]image not cropping after cropped
從圖庫中選擇圖像后,我試圖使用意圖裁剪圖像。 這是我的代碼片段
private void showFileChooser() {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
//******code for crop image
intent.putExtra("crop", "true");
intent.putExtra("aspectX", 0);
intent.putExtra("aspectY", 0);
intent.putExtra("return-data", true);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST);
}
在這里,我使用PICK_IMAGE_REQUEST意向句柄調用上述代碼段
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) {
try {
Uri filePath = data.getData();
可能有什么問題,因為我在裁剪后使用了相同的意圖,即PICK_IMAGE_REQUEST
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.