RoundedCornersTransformation

class RoundedCornersTransformation(@Px topLeft: Float = 0.0f, @Px topRight: Float = 0.0f, @Px bottomLeft: Float = 0.0f, @Px bottomRight: Float = 0.0f) : Transformation

A Transformation that crops the image to fit the target's dimensions and rounds the corners of the image.

If you're using Jetpack Compose, use Modifier.clip(RoundedCornerShape(radius)) instead of this transformation as it's more efficient.

Parameters

topLeft

The radius for the top left corner.

topRight

The radius for the top right corner.

bottomLeft

The radius for the bottom left corner.

bottomRight

The radius for the bottom right corner.

Constructors

Link copied to clipboard
constructor(@Px radius: Float)
constructor(@Px topLeft: Float = 0.0f, @Px topRight: Float = 0.0f, @Px bottomLeft: Float = 0.0f, @Px bottomRight: Float = 0.0f)

Properties

Link copied to clipboard
open override val cacheKey: String

The unique cache key for this transformation.

Functions

Link copied to clipboard
open suspend override fun transform(input: Bitmap, size: <Error class: unknown class>): Bitmap

Apply the transformation to input and return the transformed Bitmap.