code: public static Bitmap scaleFill(Bitmap src, int w, int h) {
          Bitmap res = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
          scaleFill(src, res);
          return res;
      }
docs: Scaling bitmap to fill rect with centering. Method keep aspect ratio.
  
  @param src source bitmap
  @param w   width of result
  @param h   height of result
  @return scaled bitmap