resizeToSquareBitmap

fun resizeToSquareBitmap(image: Bitmap, dstWidth: Int, dstHeight: Int): Bitmap

Resizes (crops) the given bitmap such that its dimensions are equal.

Return

Resized (cropped) bitmap with equal dimensions.

Parameters

image

Bitmap to be resized (cropped) to a square.

dstWidth

Width of the resulting bitmap.

dstHeight

Height of the resulting bitmap.