Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ferhatwi/crop
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatwi committed May 28, 2022
2 parents ebeb84e + 604997b commit 1bbc2c6
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
# crop
# Crop
Crop for Android Jetpack Compose

Modified library from [Yalantis/uCrop](https://github.com/Yalantis/uCrop).

Accepts bitmap, results bitmap.

# Usage

```kotlin
val cropView : CropView? = null

var resultBitmap by remember { mutableStateOf<Bitmap?>(null) }

AndroidView(
factory = {
CropView(it)
},
modifier = Modifier.fillMaxSize(),
update = { view ->
cropView = view
view.cropImageView.setImageBitmap(BITMAP)
view.overlayView.frame = Frame()
view.overlayView.grid = Grid()
//...
}
)

Button(onClick = {
resultBitmap = cropView.cropImageView?.crop()
}) {
Text(text = "Crop")
}
```

0 comments on commit 1bbc2c6

Please sign in to comment.