public static Bitmap createScaledBitmap(Bitmap bitmap,float scaleFactor){
  Matrix m=new Matrix();
  m.setRectToRect(new RectF(0,0,bitmap.getWidth(),bitmap.getHeight()),new RectF(0,0,bitmap.getWidth() * scaleFactor,bitmap.getHeight() * scaleFactor),Matrix.ScaleToFit.CENTER);
  return Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),m,true);
}

public static Bitmap createScaledBitmap ( Bitmap bitmap , float scaleFactor ) { Matrix m = new Matrix ( ) ; m . setRectToRect ( new RectF ( 0 , 0 , bitmap . getWidth ( ) , bitmap . getHeight ( ) ) , new RectF ( 0 , 0 , bitmap . getWidth ( ) * scaleFactor , bitmap . getHeight ( ) * scaleFactor ) , Matrix . ScaleToFit . CENTER ) ; return Bitmap . createBitmap ( bitmap , 0 , 0 , bitmap . getWidth ( ) , bitmap . getHeight ( ) , m , true ) ; }
creates new bitmap by scaling given one
