calculate In Sample Size
fun calculateInSampleSize(options: BitmapFactory.Options, destinationWidth: Int, destinationHeight: Int): Int
Gets the sample factor given a bitmap's dimensions and destination view's bounds.
Taken from https://developer.android.com/topic/performance/graphics/load-bitmap.html
Return
The sample factor. Will be a power of 2.
Parameters
options
The metadata for the bitmap. This should contain the android.graphics.BitmapFactory.Options.outHeight and android.graphics.BitmapFactory.Options.outWidth fields set.
destination Width
The width of the destination view in pixels.
destination Height
The height of the destination view in pixels.