capture

abstract fun capture(view: SurfaceView, fileName: String? = null, onSuccess: (Uri) -> Unit)

Captures the current frame of the specified SurfaceView and saves it to storage.

Parameters

view

The SurfaceView to capture.

fileName

An optional name for the saved file. If null, a default name is generated.

onSuccess

Callback invoked with the Uri of the saved image upon successful completion.