public final class

ImageCapture.OutputFileOptions.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.camera.core.ImageCapture.OutputFileOptions.Builder

Overview

Builder class for ImageCapture.OutputFileOptions.

Summary

Constructors
publicBuilder(ContentResolver contentResolver, Uri saveCollection, ContentValues contentValues)

Creates options to write captured image to .

publicBuilder(java.io.File file)

Creates options to write captured image to a java.io.File.

publicBuilder(java.io.OutputStream outputStream)

Creates options that write captured image to a java.io.OutputStream.

Methods
public ImageCapture.OutputFileOptionsbuild()

Builds ImageCapture.OutputFileOptions.

public ImageCapture.OutputFileOptions.BuildersetMetadata(ImageCapture.Metadata metadata)

Sets the metadata to be stored with the saved image.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(java.io.File file)

Creates options to write captured image to a java.io.File.

Parameters:

file: save location of the image.

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

Creates options to write captured image to . 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: to access
saveCollection: The URL of the table to insert into.
contentValues: to be included in the created image file.

public Builder(java.io.OutputStream outputStream)

Creates options that write captured image to a java.io.OutputStream.

Parameters:

outputStream: save location of the image.

Methods

Sets the metadata to be stored with the saved image.

For JPEG this will be included in the EXIF.

Parameters:

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

Builds ImageCapture.OutputFileOptions.