title: Cropping Pictures in Android by keeping Aspect Ratio
body: <p>I use this code to start the crop activity and i get the cropped picture as data in onActivityResult back. So this works fine.</p>
  
  <pre><code>    Intent intent = new Intent("com.android.camera.action.CROP");
      intent.setType("image/*");
  
      List&lt;ResolveInfo&gt; list = getPackageManager().queryIntentActivities(
              intent, 0);
  
      int size = list.size();
  
      if (size == 0) {
          Toast.makeText(this, "Can not find image crop app",
                  Toast.LENGTH_SHORT).show();
          return;
      } else {
          intent.setData(mImageCaptureUri);
  
          intent.putExtra("outputX", 200);
          intent.putExtra("outputY", 200);
          intent.putExtra("scale", true);
          intent.putExtra("return-data", true);
  
          Intent i = new Intent(intent);
          ResolveInfo res = list.get(0);
  
          i.setComponent(new ComponentName(res.activityInfo.packageName,
                  res.activityInfo.name));
  
          startActivityForResult(i, CROP_FROM_CAMERA);
  </code></pre>
  
  <p>This is the code for cropping the image into the size of 200x200, dont matter which aspect ratio I chose at the cropping activity. My concern is, that i want THE aspect ratio which i choose with the rectangle in the activity, not a fixed by putting the numbers 200 and 200.</p>
  
  <p>But when I comment out these two lines, my program will force close.... </p>
  
  <p>Are there any solutions for cropping exact to the part of the picture which i chose in the crop activity with keeping the aspect ratio from the rectangle I placed on my picture?
  Which data do I have to put as extras? Need Help!</p>