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 null for none — the page is then displayed with no editable outline over it, and edits resolve back to null.
  • params — a CropImageParams to setup CropPicture
  • onPictureReady — called with false when loading starts, and with true once the page is displayed. It is not called with true at all if no picture is supplied or loading fails, so do not treat a single false as a transient state.
  • onCutoutChanged — called whenever the displayed outline changes, with the outline now shown, or null when there is none.
Top