title: How can I resize image captured by default camera?
body: <p>I capture photo with default camera by calling</p>
  
  <pre><code>Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  startActivityForResult(cameraIntent, ApplicationData.CAMERA_REQUEST);
  </code></pre>
  
  <p>Then I save the photo to sdcard and retrieve it and set it to ImageView</p>
  
  <pre><code>OutputStream output;
  Bitmap photo = (Bitmap) data.getExtras().get("data");
  output = new FileOutputStream(file);
  photo.compress(Bitmap.CompressFormat.PNG, 100, output);
  output.flush();
  output.close();
  mThumbnaiImagelLayout.setVisibility(View.VISIBLE);
  mImageThumbNail.setImageBitmap(photo);
  </code></pre>
  
  <p>What I want in ImageView is exactly the same like thumbnail image of the device.For example:</p>
  
  <p><a href="https://i.stack.imgur.com/Vgwdz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vgwdz.jpg" alt="enter image description here"></a></p>
  
  <p>But it become like this</p>
  
  <p><a href="https://i.stack.imgur.com/vFEjm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vFEjm.png" alt="enter image description here"></a></p>
  
  <p>So my question is:</p>
  
  <p>1/How can I resize captured image?</p>
  
  <p>2/Is any other way I can set image to ImageView without bitmap? Because when I set ImageView with Bitmap, it look terrible, like this (the image's size is 512x512)</p>
  
  <p><a href="https://i.stack.imgur.com/ckMJo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ckMJo.jpg" alt="enter image description here"></a></p>
  
  <p>Please help me to solve this problem.Thank you!</p>