Compose Image Cropper
Image cropping library written with Jetpack Compose with other Composables such as ImageWithConstraints
scales Bitmap it displays and returns position and bounds of Bitmap and ImageWithThumbnail
to display thumbnail of the image on selected corner.
⚠️
Work in Progress
-
ImageWithConstraints
displaysImageBitmap
s asandroidx.compose.foundation.Image
but unlikeImage
,ImageWithConstraints
returnsImageScope
which contains width and height of drawing area(Canvas) in dp, and actualIntRect
ofImagebitmap
. This rectangle's bounds change depending on which section of theImageBitmap
is drawn. For instance, for 1000x1000px image withContentScale.Crop
IntRect can be such asIntRect(250,250,500,500)
. UsingImageWithConstraint
building other Composables likeImageThumbnail
that require area of drawing and actual bounds ofImageBİtmap
that is drawn can be achieved easily. -
ImageWithThumbnail
shows zoomed thumbnail at top left or top right corner of the image that is being displayed