title: Android create scaled and rotated Bitmap
body: <p>The following code works to create a rotated and scaled Bitmap from another Bitmap bmpSrc:</p>
  
  <pre><code>                final int srcWidth = bmpSrc.getWidth();
                  final int srcHeight = bmpSrc.getHeight();
                  final float sx = (float)reqWidth  / (float)srcWidth;
                  final float sy = (float)reqHeight / (float)srcHeight;
  
                  Matrix m = new Matrix();
                  m.setScale(sx, sy);
                  final float px = (float) srcWidth / 2;
                  final float py = (float) srcHeight / 2;
                  m.setRotate(270, px, py);
  
                  bmpFillScreen = Bitmap.createBitmap(bmpSrc, 0, 0, reqHeight, reqWidth, m, true);
  </code></pre>
  
  <p>But on some devices (especially 10 inch tablets) it throws this Exception:</p>
  
  <pre><code>java.lang.IllegalArgumentException: x + width must be &lt;= bitmap.width()
  at android.graphics.Bitmap.createBitmap(Bitmap.java:554)
  </code></pre>
  
  <p>What can I do to solve that?</p>