CropPicture Function
@Composable fun CropPicture(modifier: Modifier, picture: ScanPicture?, orientation: ScanOrientation? = null, cutout: ScanCutout? = null, params: CropImageParams = defaultCropImageParams( defaultZoomImageParams( PaddingValues(40.dp) ) ), onPictureReady: suspend (Boolean) -> Unit = { _ -> }, onCutoutChanged: (ScanCutout?) -> Unit)
A Composable to show a picture and edit a document cutout.
Parameters
- modifier — a Composable Modifier.
- picture — a ScanPicture instance. Can be null to show nothing.
- orientation — an optional ScanOrientation instance. If it is missing, ScanPicture.orientation will be used.
- cutout — the outline to show and edit, or
nullfor none — the page is then displayed with no editable outline over it, and edits resolve back tonull. - params — a CropImageParams to setup CropPicture
- onPictureReady — called with
falsewhen loading starts, and withtrueonce the page is displayed. It is not called withtrueat all if no picture is supplied or loading fails, so do not treat a singlefalseas a transient state. - onCutoutChanged — called whenever the displayed outline changes, with the outline now shown, or
nullwhen there is none.