scaleAndCrop

fun Bitmap.scaleAndCrop(size: Size, filter: Boolean = false): Bitmap

Scale the Bitmap to circumscribe the given Size, then crop the excess.