Builder
class Builder
kotlin.Any | |
↳ | androidx.camera.core.ImageCapture.OutputFileOptions.Builder |
Builder class for OutputFileOptions
.
Summary
Public constructors | |
---|---|
Creates options to write captured image to a |
|
<init>(@NonNull contentResolver: ContentResolver, @NonNull saveCollection: Uri, @NonNull contentValues: ContentValues) Creates options to write captured image to |
|
<init>(@NonNull outputStream: OutputStream) Creates options that write captured image to a |
Public methods | |
---|---|
ImageCapture.OutputFileOptions |
build() Builds |
ImageCapture.OutputFileOptions.Builder |
setMetadata(@NonNull metadata: ImageCapture.Metadata) Sets the metadata to be stored with the saved image. |
Public constructors
<init>
Builder(@NonNull file: File)
Creates options to write captured image to a File
.
Parameters | |
---|---|
file |
File: save location of the image. |
<init>
Builder(
@NonNull contentResolver: ContentResolver,
@NonNull saveCollection: Uri,
@NonNull contentValues: ContentValues)
Creates options to write captured image to MediaStore
. Example:
<code>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(); </code>
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. |
<init>
Builder(@NonNull outputStream: OutputStream)
Creates options that write captured image to a OutputStream
.
Parameters | |
---|---|
outputStream |
OutputStream: save location of the image. |
Public methods
setMetadata
@NonNull fun setMetadata(@NonNull 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. |