ImageCapture.OutputFileOptions.Builder


class ImageCapture.OutputFileOptions.Builder


Builder class for OutputFileOptions.

Summary

Public constructors

Builder(file: File)

Creates options to write captured image to a File.

Builder(outputStream: OutputStream)

Creates options that write captured image to a OutputStream.

Builder(
    contentResolver: ContentResolver,
    saveCollection: Uri,
    contentValues: ContentValues
)

Creates options to write captured image to MediaStore.

Public functions

ImageCapture.OutputFileOptions

Builds OutputFileOptions.

ImageCapture.OutputFileOptions.Builder

Sets the metadata to be stored with the saved image.

Public constructors

Builder

Added in 1.0.0
Builder(file: File)

Creates options to write captured image to a File.

Parameters
file: File

save location of the image.

Builder

Added in 1.0.0
Builder(outputStream: OutputStream)

Creates options that write captured image to a OutputStream.

Parameters
outputStream: OutputStream

save location of the image.

Builder

Added in 1.0.0
Builder(
    contentResolver: ContentResolver,
    saveCollection: Uri,
    contentValues: ContentValues
)

Creates options to write captured image to MediaStore. Example:

ContentValues contentValues = new ContentValues();
contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, "NEW_IMAGE");
contentValues.put(MediaStore.MediaColumns.MIME_TYPE, "image/jpeg");

ImageCapture.OutputFileOptions options = new ImageCapture.OutputFileOptions.Builder(
        getContentResolver(),
        MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
        contentValues).build();
Parameters
contentResolver: ContentResolver

to access MediaStore

saveCollection: Uri

The URL of the table to insert into.

contentValues: ContentValues

to be included in the created image file.

Public functions

setMetadata

Added in 1.0.0
fun setMetadata(metadata: ImageCapture.Metadata): ImageCapture.OutputFileOptions.Builder

Sets the metadata to be stored with the saved image.

For JPEG this will be included in the EXIF.

Parameters
metadata: ImageCapture.Metadata

Metadata to be stored with the saved image. For JPEG this will be included in the EXIF.