rememberSubSamplingImageState

fun rememberSubSamplingImageState(imageSource: SubSamplingImageSource, zoomableState: ZoomableState, imageOptions: ImageBitmapOptions = ImageBitmapOptions.Default, errorReporter: SubSamplingImageErrorReporter = SubSamplingImageErrorReporter.NoOpInRelease): SubSamplingImageState

Create a SubSamplingImageState that can be used with SubSamplingImage which uses Modifier.zoomable as its gesture detector.

val zoomableState = rememberZoomableState()
val imageState = rememberSubSamplingImageState(
zoomableState = zoomableState,
imageSource = SubSamplingImageSource.asset("fox.jpg")
)

SubSamplingImage(
modifier = Modifier
.fillMaxSize()
.zoomable(zoomableState),
state = imageState,
contentDescription = …,
)