FilePath
data class FilePath(val path: String, val mimeType: MimeType = MimeType.tryDetect(path)) : ImageSource
An image referenced by local file path.
Samples
// Create an image from FilePath.
val imageSource =
ImageSource.FilePath(path = "path/to/photo.png", mimeType = MimeType.Image.Png) // By default, the MIME type is detected based on the file extension.
.takeIf { it.exists() }
imageSource.let { image ->
// Add image Source to content and send to API...
}Content copied to clipboard
Constructors
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Serializes this ImageSource to a string representation.