CropImageParams Class
@Immutable data class CropImageParams(val cropGrip: Painter, val cropHalo: Painter, val edgeGrip: Painter, val edgeHalo: Painter, val normalLineColor: Color, val normalLineStyle: DrawStyle, val invalidLineColor: Color, val invalidLineStyle: DrawStyle, val zoomImageParams: ZoomImageParams, val blurRadius: Dp)
How the crop surface looks and behaves: handle size, stroke widths, and colours.
The outline is drawn in the normal colour and style while the four corners form a valid quadrilateral, and in the invalid pair as soon as they do not — dragging one corner past another, for instance. The same colour tints the grip images, so the whole surface changes together.
Parameters
- cropGrip — the image drawn at each corner the user can drag.
- cropHalo — the image drawn behind a corner grip to show its touch area.
- edgeGrip — the image drawn at the midpoint of each edge.
- edgeHalo — the image drawn behind an edge grip to show its touch area.
- normalLineColor — the outline colour while the corners form a valid shape.
- normalLineStyle — the stroke used for that outline.
- invalidLineColor — the outline colour once the corners no longer form a valid shape.
- invalidLineStyle — the stroke used for that outline; dashed by default, so the state reads without relying on colour alone.
- zoomImageParams — how the page behind the crop surface zooms and pans.
- blurRadius — how strongly the area outside the crop is blurred. Set it to
0.dpto leave the page unblurred; the effect also needs Android 12, and is skipped below it.
Constructors
CropImageParams
constructor(cropGrip: Painter, cropHalo: Painter, edgeGrip: Painter, edgeHalo: Painter, normalLineColor: Color, normalLineStyle: DrawStyle, invalidLineColor: Color, invalidLineStyle: DrawStyle, zoomImageParams: ZoomImageParams, blurRadius: Dp)
Properties
blurRadius
val blurRadius: Dp
cropGrip
val cropGrip: Painter
cropHalo
val cropHalo: Painter
edgeGrip
val edgeGrip: Painter
edgeHalo
val edgeHalo: Painter
invalidLineColor
val invalidLineColor: Color
invalidLineStyle
val invalidLineStyle: DrawStyle
normalLineColor
val normalLineColor: Color
normalLineStyle
val normalLineStyle: DrawStyle
zoomImageParams
val zoomImageParams: ZoomImageParams