-
- All Implemented Interfaces:
-
coil.transform.Transformation
public final class RoundedCornersTransformation implements 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.
-
-
Constructor Summary
Constructors Constructor Description RoundedCornersTransformation(Float radius)RoundedCornersTransformation(Float topLeft, Float topRight, Float bottomLeft, Float bottomRight)
-
Method Summary
-
-
Constructor Detail
-
RoundedCornersTransformation
RoundedCornersTransformation(Float radius)
-
RoundedCornersTransformation
RoundedCornersTransformation(Float topLeft, Float topRight, Float bottomLeft, Float bottomRight)
- 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.
-
-
Method Detail
-
getCacheKey
String getCacheKey()
The unique cache key for this transformation.
The key is added to the image request's memory cache key and should contain any params that are part of this transformation (e.g. size, scale, color, radius, etc.).
-
transform
Bitmap transform(Bitmap input, Size size)
- Parameters:
input- The input Bitmap to transform.size- The size of the image request.
-
-
-
-