title: Android Crop Center of Bitmap
body: <p>I have bitmaps which are squares or rectangles. I take the shortest side and do something like this:</p>
  
  <pre><code>int value = 0;
  if (bitmap.getHeight() &lt;= bitmap.getWidth()) {
      value = bitmap.getHeight();
  } else {
      value = bitmap.getWidth();
  }
  
  Bitmap finalBitmap = null;
  finalBitmap = Bitmap.createBitmap(bitmap, 0, 0, value, value);
  </code></pre>
  
  <p>Then I scale it to a 144 x 144 Bitmap using this:</p>
  
  <pre><code>Bitmap lastBitmap = null;
  lastBitmap = Bitmap.createScaledBitmap(finalBitmap, 144, 144, true);
  </code></pre>
  
  <p>Problem is that it crops the top left corner of the original bitmap, Anyone has the code to crop the center of the bitmap?</p>