开发者

Android:problem on cropping image by camera activity

I have made an App in which I have captured an image from camera and a rectangle is shown to crop the selected area. But I'm facing two big problems in it:

  1. when we change the dimensions of rectangle appeared to large size for cropping the image then instead of showing cropped image file it restart camera activity?while the same thing I have done in taking image from gallery and it is working.

  2. aspect ratio is not working for image taken from camera activity?

Code for camera activity:

public void onClick(DialogInterface dialog, int item)
{
 开发者_运维问答       Intent intent = new Intent();
        intent.putExtra("crop", "true"); 
        intent.putExtra("aspectX", 774);
        intent.putExtra("aspectY", 1115);
        intent.putExtra("outputX", 774);
        intent.putExtra("outputY", 1115);

        if(item==0)
        {
            intent.setAction("android.media.action.IMAGE_CAPTURE");
        startActivityForResult(intent, PICK_FROM_CAMERA);
    }


check out these links

http://www.brighthub.com/mobile/google-android/articles/43414.aspx

http://androidcore.com/android-programming-tutorials/629.html

How to use web camera in android emulator to capture a live image?

http://www.tomgibara.com/android/camera-source

http://marakana.com/forums/android/examples/39.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜