# ImageCaptureExtKt

Added in 1.4.0

*** ** * ** ***


```
public final class ImageCaptureExtKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/ImageProxy` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureExtKt#(androidx.camera.core.ImageCapture).takePicture(kotlin.Function0,kotlin.Function1,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/ImageCapture receiver, Function0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onCaptureStarted, Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onCaptureProcessProgressed, Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Bitmap.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onPostviewBitmapAvailable )` Captures a new still image for in memory access. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/ImageCapture.OutputFileResults` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureExtKt#(androidx.camera.core.ImageCapture).takePicture(androidx.camera.core.ImageCapture.OutputFileOptions,kotlin.Function0,kotlin.Function1,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/ImageCapture receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/ImageCapture.OutputFileOptions outputFileOptions, Function0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onCaptureStarted, Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onCaptureProcessProgressed, Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Bitmap.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onPostviewBitmapAvailable )` Captures a new still image and saves to a file along with application specified metadata. |

## Public methods

### takePicture

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/ImageCaptureExt.kt+function:takePicture)

```
public static final @NonNull ImageProxy takePicture(
    @NonNull ImageCapture receiver,
    Function0<Unit> onCaptureStarted,
    Function1<@NonNull Integer, Unit> onCaptureProcessProgressed,
    Function1<@NonNull Bitmap, Unit> onPostviewBitmapAvailable
)
```

Captures a new still image for in memory access.

The caller is responsible for calling `https://developer.android.com/reference/androidx/camera/core/ImageProxy#close()` on the returned image.

| Parameters |
|---|---|
| `Function0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onCaptureStarted` | Callback for when the camera has started exposing the frame. |
| `Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onCaptureProcessProgressed` | Callback to report the progress of the capture's processing. |
| `Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Bitmap.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onPostviewBitmapAvailable` | Callback to notify that the postview bitmap is available. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/camera/core/ImageCapture#takePicture(java.util.concurrent.Executor,androidx.camera.core.ImageCapture.OnImageCapturedCallback)` |   |
| `https://developer.android.com/reference/androidx/camera/core/ImageCapture.OnImageCapturedCallback` |   |

### takePicture

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/ImageCaptureExt.kt+function:takePicture)

```
public static final @NonNull ImageCapture.OutputFileResults takePicture(
    @NonNull ImageCapture receiver,
    @NonNull ImageCapture.OutputFileOptions outputFileOptions,
    Function0<Unit> onCaptureStarted,
    Function1<@NonNull Integer, Unit> onCaptureProcessProgressed,
    Function1<@NonNull Bitmap, Unit> onPostviewBitmapAvailable
)
```

Captures a new still image and saves to a file along with application specified metadata.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/ImageCapture.OutputFileOptions outputFileOptions` | Options to store the output image file. |
| `Function0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onCaptureStarted` | Callback for when the camera has started exposing the frame. |
| `Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onCaptureProcessProgressed` | Callback to report the progress of the capture's processing. |
| `Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Bitmap.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onPostviewBitmapAvailable` | Callback to notify that the postview bitmap is available. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/camera/core/ImageCapture#takePicture(java.util.concurrent.Executor,androidx.camera.core.ImageCapture.OnImageCapturedCallback)` |   |
| `https://developer.android.com/reference/androidx/camera/core/ImageCapture.OnImageSavedCallback` |   |