拍照后修正裁剪尺寸

时间:2014-09-30 15:42:37

标签: android android-camera

我正在尝试实现我在网上找到的一些代码,但它似乎无法正常工作,我无法判断我是否遗漏了某些内容。

我可以使用手机的CROP功能,但作物的边界不会以任何方式修复。它们可以被操纵,我希望它们是图像宽度的最大尺寸。

问题源于intent.putExtra(MediaStore.EXTRA_OUTPUT,fileUri);

public void takePicture() {

    // create Intent to take a picture and return control to the calling
    // application
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

    fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);

    intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
    intent.putExtra("crop", "true");
    intent.putExtra("aspectX", 1);
    intent.putExtra("aspectY", 1);
    intent.putExtra("outputX", 200);
    intent.putExtra("outputY", 200);
    intent.putExtra("scale", true);
    intent.putExtra("scaleUpIfNeeded", true);

    // start the image capture Intent
    startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}

0 个答案:

没有答案
相关问题