【发布时间】:2011-10-18 18:51:35
【问题描述】:
我们能否为从相机捕获的在运行时裁剪的图像提供纵横比。so 为参数
1.intent.putExtra("crop","true"); works
2.intent.putExtra("aspectX",730); not working
3.intent.putExtra("aspectY",1115); not working
4.intent.putExtra("outputX",730); not working
5.intent.putExtra("outputY",1115); not working
:当它适用于从图库中获取的图像时
这是为相机活动捕获的图像提供纵横比的方法吗?我需要你的帮助吗? 谢谢
更新-->代码
public void onClick(DialogInterface dialog, int item)
{
Intent intent = new Intent();
intent.putExtra("crop", "true");
intent.putExtra("aspectX", 730);
intent.putExtra("aspectY", 735);
intent.putExtra("outputX", 730);
intent.putExtra("outputY", 735);
if(item==0)
{
intent.setAction("android.media.action.IMAGE_CAPTURE");
startActivityForResult(intent, PICK_FROM_CAMERA);
}
【问题讨论】:
-
你运行的是哪个版本的android
-
哦!抱歉,android sdk 2.1 不支持在相机中裁剪。
-
你确定吗?那么它支持哪个版本?
-
我已经在 2.3 中尝试过,但没有工作
-
你能发布你的相机意图代码吗?
标签: android android-sdk-2.1 aspect-ratio