title: Zooming the Bitmap on Surfaceview in Android
body: <p>I want to resize the bitmap slowly (like zooming in the bitmap )on surface view. When I set some standard increased values for width and height, it will displays the bigger image.As I give below in onDraw method</p>
  
  <pre><code>can.drawBitmap(gball, lastVisitedX, lastVisitedY, paint);
                  gball = getResizedBitmap(gball, bitmapInitHeight
                          + bitmapInitHeight, bitmapInitHeight + bitmapInitHeight);
  
  
  public Bitmap getResizedBitmap(Bitmap bm, int newHeight, int newWidth) {
  
          int width = bm.getWidth();
          int height = bm.getHeight();
          float scaleWidth = ((float) newWidth) / width;
          float scaleHeight = ((float) newHeight) / height;
          Matrix matrix = new Matrix();
          matrix.postScale(scaleWidth, scaleHeight);
          Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height,
                  matrix, false);
          return resizedBitmap;
  
      }
  </code></pre>
  
  <p>But when I try to resize by increasing the height and width like </p>
  
  <pre><code>can.drawBitmap(gball, lastVisitedX, lastVisitedY, paint);
                  gball = getResizedBitmap(gball, bitmapInitHeight
                          + zoomXValue, bitmapInitHeight + zoomYValue);
  
  zoomXValue= zoomXValue+5;
  zoomYValue= zoomYValue+5;
  </code></pre>
  
  <p>In onDraw method but the bitmap is resize with bad quality.</p>
  
  <p>Finally my question is how to scale like zooming out with out damaging the quality.</p>
  
  <p>Thanks in Advance.</p>