ImageCapture.OutputFileOptions.Builder
public final class ImageCapture.OutputFileOptions.Builder
Builder class for OutputFileOptions.
Summary
Public constructors |
|---|
|
Creates options to write captured image to a |
Builder(@NonNull OutputStream outputStream)Creates options that write captured image to a |
Builder(Creates options to write captured image to |
Public methods |
|
|---|---|
@NonNull ImageCapture.OutputFileOptions |
build()Builds |
@NonNull ImageCapture.OutputFileOptions.Builder |
setMetadata(@NonNull ImageCapture.Metadata metadata)Sets the metadata to be stored with the saved image. |
Public constructors
Builder
public Builder(@NonNull File file)
Creates options to write captured image to a File.
Builder
public Builder(@NonNull OutputStream outputStream)
Creates options that write captured image to a OutputStream.
| Parameters | |
|---|---|
@NonNull OutputStream outputStream |
save location of the image. |
Builder
public Builder(
@NonNull ContentResolver contentResolver,
@NonNull Uri saveCollection,
@NonNull 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 | |
|---|---|
@NonNull ContentResolver contentResolver |
to access |
@NonNull Uri saveCollection |
The URL of the table to insert into. |
@NonNull ContentValues contentValues |
to be included in the created image file. |
Public methods
build
public @NonNull ImageCapture.OutputFileOptions build()
Builds OutputFileOptions.
setMetadata
public @NonNull ImageCapture.OutputFileOptions.Builder setMetadata(@NonNull ImageCapture.Metadata metadata)
Sets the metadata to be stored with the saved image.
For JPEG this will be included in the EXIF.
| Parameters | |
|---|---|
@NonNull ImageCapture.Metadata metadata |
Metadata to be stored with the saved image. For JPEG this will be included in the EXIF. |