Store Image

class StoreImage(handler: CameraXHandler) : ImageCapture.OnImageSavedCallback

Use case of androidx.camera.core.CameraX to store image

Author

Jimly A.

Since

13-Sep-21

Parameters

handler

instance of CameraXHandler

Constructors

Link copied to clipboard
fun StoreImage(handler: CameraXHandler)

return instance of StoreImage

Functions

Link copied to clipboard
open override fun onError(exception: ImageCaptureException)

method listener when storing image failed

Link copied to clipboard
open override fun onImageSaved(outputFileResults: ImageCapture.OutputFileResults)

method listener when image stored successfully

Link copied to clipboard
fun saveImage(toFile: File, saveAction: (Boolean, String) -> Unit)

method to store the preview as image

Properties

Link copied to clipboard
var action: (Boolean, String) -> Unit? = null

listener when storing the image

Sources

Link copied to clipboard