我有这样的代码从图片库,但即使有intent.putExtra("crop", "true");
获取图像,但不会裁剪
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", 0);
intent.putExtra("aspectY", 0);
intent.putExtra("outputX", 360);
intent.putExtra("outputY", 360);
try
{
intent.putExtra("return-data", true);
startActivityForResult(Intent.createChooser(intent, "Complete action using"), req_code);
}
catch(ActivityNotFoundException e)
{
// Do nothing for now
}
获取的图像,选择图像后,它不会显示任何作物活动或任何...为什么?
',将scaleType设置为CenterCrop – longkai
这实际上非常有帮助!我要这样做,直到我找到合适的方式来裁剪图像。 – fcasanova
好吧,如果你的图像非常大,它会出现'outOfMemory'问题,你最好按照谷歌的开发指南或使用库来裁剪大图像。 – longkai