我有選擇的圖像無論是從畫廊或捕捉的相機圖像,我想裁剪圖像我所得到的,無法裁切的Android
所以,我用下面的代碼來調用作物意圖,
Intent cropIntent = new Intent("com.android.camera.action.CROP");
//indicate image type and Uri
cropIntent.setDataAndType(imageUri, "image/*");
//set crop properties
cropIntent.putExtra("crop", "true");
//retrieve data on return
cropIntent.putExtra("return-data", true);
try {
startActivityForResult(cropIntent, REQUEST_CODE_FOR_CROP_DONE);
} catch (ActivityNotFoundException actionNotFoundException) {
Log.e(TAG, actionNotFoundException.getMessage(), actionNotFoundException);
Toast.makeText(fragment.getActivity(), fragment.getResources().getString(R.string.crop_not_available), Toast.LENGTH_SHORT).show();
}
我使用的是Nexus 6p設備,似乎只有在這個設備上我面臨這個問題。
這給我敬酒消息說,可以在下面50×50
不作物圖像可能我知道我缺少什麼?
請查看本博客:https://commonsware.com/博客/ 2013/01/23 /無的Android此結果不具備的,作物intent.html –