core-ktx / androidx.graphics.drawable / android.graphics.drawable.Drawable

Extensions for android.graphics.drawable.Drawable

toBitmap

fun Drawable.toBitmap(width: Int = intrinsicWidth, height: Int = intrinsicHeight, config: Config? = null): Bitmap

Return a Bitmap representation of this Drawable.

updateBounds

fun Drawable.updateBounds(left: Int = bounds.left, top: Int = bounds.top, right: Int = bounds.right, bottom: Int = bounds.bottom): Unit

Updates this drawable's bounds. This version of the method allows using named parameters to just set one or more axes.