code: public CloseableReference<Bitmap> createScaledBitmap(
        Bitmap source,
        int destinationWidth,
        int destinationHeight,
        boolean filter,
        @Nullable Object callerContext) {
      checkWidthHeight(destinationWidth, destinationHeight);
  
      Matrix matrix = new Matrix();
      final int width = source.getWidth();
      final int height = source.getHeight();
      final float sx = destinationWidth  / (float) width;
      final float sy = destinationHeight / (float) height;
      matrix.setScale(sx, sy);
  
      return createBitmap(source, 0, 0, width, height, matrix, filter, callerContext);
    }
docs: Creates a bitmap from the specified source scaled to have the height and width
  as specified. It is initialized with the same density as the original bitmap.
  
  @param source   The bitmap we are subsetting
  @param destinationWidth    The number of pixels in each row of the final bitmap
  @param destinationHeight   The number of rows in the final bitmap
  @param callerContext the Tag to track who create the Bitmap
  @return a reference to the bitmap
  @throws IllegalArgumentException if the destinationWidth is <= 0,
  or destinationHeight is <= 0
  @throws TooManyBitmapsException if the pool is full
  @throws java.lang.OutOfMemoryError if the Bitmap cannot be allocated