Lightweight image cropper for Android Jetpack Compose.
settings.gradle.kts.dependencyResolutionManagement {
...
repositories {
...
maven("https://jitpack.io")
}
}
dependencies {
implementation("com.github.moyuruaizawa:cropify:${cropifyVersion}")
}
Bitmap
val state = rememberCropifyState()
Cropify(
bitmap = imageResource(R.drawable.bitmap),
state = state,
onImageCropped = {},
option = CropifyOption(
frameSize = FullSize
),
)
Uri
val state = rememberCropifyState()
Cropify(
uri = imageUri,
state = state,
onImageCropped = {},
onFailedToLoadImage = {},
option = CropifyOption(
frameSize = FullSize
),
)
Invoke CropifyState#crop, the cropped image will be passed to onImageCropped.
If loading an image from Uri fails, onFailedToLoadImage will be called.
I would like to thank ArthurHub/Android-Image-Cropper.
Cropify aims to a Jetpack Compose implementation of ArthurHub/Android-Image-Cropper.
Kotlin
100.0%
Lightweight image cropper for Android Jetpack Compose.
settings.gradle.kts.dependencyResolutionManagement {
...
repositories {
...
maven("https://jitpack.io")
}
}
dependencies {
implementation("com.github.moyuruaizawa:cropify:${cropifyVersion}")
}
Bitmap
val state = rememberCropifyState()
Cropify(
bitmap = imageResource(R.drawable.bitmap),
state = state,
onImageCropped = {},
option = CropifyOption(
frameSize = FullSize
),
)
Uri
val state = rememberCropifyState()
Cropify(
uri = imageUri,
state = state,
onImageCropped = {},
onFailedToLoadImage = {},
option = CropifyOption(
frameSize = FullSize
),
)
Invoke CropifyState#crop, the cropped image will be passed to onImageCropped.
If loading an image from Uri fails, onFailedToLoadImage will be called.
I would like to thank ArthurHub/Android-Image-Cropper.
Cropify aims to a Jetpack Compose implementation of ArthurHub/Android-Image-Cropper.
Kotlin
100.0%