DrawableUtil

Utility class to convert and rotate drawables.

Functions

Link copied to clipboard
fun drawableToBitmap(drawable: Drawable, width: Int = drawable.intrinsicHeight, height: Int = drawable.intrinsicHeight): Bitmap?

Converts a drawable into a bitmap.

Link copied to clipboard
fun getRotatedDrawable(drawable: Drawable, rotationDegrees: Float = -90f): Drawable

Rotates a drawable while preserving its aspect ratio.