4

Can we provide aspect ratio for the image captured from camera that is cropped at runtime.so for the parameter

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

:While it is working for the image taken from gallery

Is this the way to provide aspect ratio or not for image captured by camera activity?I need your help? Thanks

UPDATE--> CODE

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);
                    }
Geetanjali
  • 1,043
  • 3
  • 13
  • 37

1 Answers1

0

try this code;

intent.putExtra("crop","true");      
intent.putExtra("aspectX",3);      
intent.putExtra("aspectY",4);     
intent.putExtra("outputX",730);     
intent.putExtra("outputY",1115);

but i think intent.putExtra("outputY",1115); is not possible because 1115 height may not be possible.

ilango j
  • 5,967
  • 2
  • 28
  • 25
  • hi try your code in sdk 2.2 version camera cropping will work sure. – ilango j Aug 03 '11 at 05:08
  • 1
    sure camera cropping will not work in android 2.1. But gallery image cropping will work sure. because camera using one class name for cropping but gallery using different class for cropping. so cropping will work for only gallery in android 2.1 – ilango j Aug 03 '11 at 05:22
  • there is another solution for that first take picture normally without using cropping and then call cropping for saved image. for more clearly refer this http://groups.google.com/group/android-developers/browse_thread/thread/6b9aeefdd51d462f# – ilango j Aug 03 '11 at 06:12