title: Bitmap quality lost after scaling canvas
body: <p>I want to paint a Bitmap scaled in a canvas (based on the Bitmap and the View size). The problem is that if I scale the canvas before painting the bitmap:</p>
  
  <pre><code> canvas.scale(1.5f,1.5f);
   canvas.drawBitmap(mBitmap, 0, 0, paint);
  </code></pre>
  
  <p>This is the result:</p>
  
  <p><img src="https://i.stack.imgur.com/puh2Z.png" alt="aliased image"></p>
  
  <p>But if instead of scaling the canvas I scale the bitmap:</p>
  
  <pre><code>Bitmap scaled = Bitmap.createScaledBitmap(
          mBitmap, bitmapWidth, bitmapHeight,
          true);
  canvas.drawBitmap(scaledBitmap, 0, 0, paint);
  </code></pre>
  
  <p>The result is much better:
  <img src="https://i.stack.imgur.com/nOLgM.png" alt="Correctly scaled image"></p>
  
  <p>The problem is that the Bitmap is pretty big and having in memory both the original and the scaled bitmap may be problematic.</p>
  
  <p>Is there any way to obtain the second result without creating a scaled Bitmap every time the Bitmap or the View bounds changes?</p>