The image message body class.
ImageMessageBody(File imageFile)
Definition: ImageMessageBody.java:81
◆ ImageMessageBody() [1/5]
io.agora.chat.ImageMessageBody.ImageMessageBody |
( |
File |
imageFile | ) |
|
Creates an image message body with an image file.
Reference: There are five ways to create an image message body as follows:
Creates an image message body with an image file:
- Parameters
-
imageFile | The image message body. |
◆ ImageMessageBody() [2/5]
io.agora.chat.ImageMessageBody.ImageMessageBody |
( |
Uri |
imageUri | ) |
|
Creates an image message body with the image URI.
- Parameters
-
◆ ImageMessageBody() [3/5]
io.agora.chat.ImageMessageBody.ImageMessageBody |
( |
File |
imageFile, |
|
|
File |
thumbnailFile |
|
) |
| |
Creates an image message body with an image and its thumbnail.
- Parameters
-
imageFile | The original image file. |
thumbnailFile | The thumbnail image file. |
◆ ImageMessageBody() [4/5]
io.agora.chat.ImageMessageBody.ImageMessageBody |
( |
Uri |
imageLocalPath, |
|
|
Uri |
thumbnailPath |
|
) |
| |
Creates an image message body with the URI of an image and its thumbnail.
- Parameters
-
imageLocalPath | The original image URI. |
thumbnailPath | The thumbnail image URI. |
◆ ImageMessageBody() [5/5]
io.agora.chat.ImageMessageBody.ImageMessageBody |
( |
EMAImageMessageBody |
body | ) |
|
Creates an image message body with an EMAImageMessageBody
instance.
- Parameters
-
body | The EMAImageMessageBody instance. |
◆ getFileName()
String io.agora.chat.ImageMessageBody.getFileName |
( |
| ) |
|
◆ getFileSize()
long io.agora.chat.ImageMessageBody.getFileSize |
( |
| ) |
|
Gets the size of the image file.
- Returns
- The size of the image file.
◆ getHeight()
int io.agora.chat.ImageMessageBody.getHeight |
( |
| ) |
|
Gets the image height.
- Returns
- The image height.
◆ getThumbnailSecret()
String io.agora.chat.ImageMessageBody.getThumbnailSecret |
( |
| ) |
|
Gets the secret to access the thumbnail. A secret is required for verification for thumbnail download.
- Returns
- The secret to access the thumbnail.
◆ getThumbnailUrl()
String io.agora.chat.ImageMessageBody.getThumbnailUrl |
( |
| ) |
|
Gets the URL of the thumbnail on the server.
If ChatOptions#setAutoDownloadThumbnail(boolean) is set, the thumbnail will be downloaded from the path specified with thumbnailRemotePath to a local path during message reception.
- Returns
- The URL of the thumbnail on the server.
◆ getWidth()
int io.agora.chat.ImageMessageBody.getWidth |
( |
| ) |
|
Gets the image width.
- Returns
- The image width.
◆ isSendOriginalImage()
boolean io.agora.chat.ImageMessageBody.isSendOriginalImage |
( |
| ) |
|
Gets whether to send the original image.
- Returns
- Whether to send the original image. -(Default)
false
: Send the thumbnail(image with size larger than 100k will be compressed);
true
: Send the original image.
◆ setSendOriginalImage()
void io.agora.chat.ImageMessageBody.setSendOriginalImage |
( |
boolean |
sendOriginalImage | ) |
|
Sets whether to send the original image when sending an image.
- Parameters
-
sendOriginalImage | Whether to send the original image. -(Default)false : Send the thumbnail(image with size larger than 100k will be compressed);
true : Send the original image.
|
◆ setThumbnailLocalPath() [1/2]
void io.agora.chat.ImageMessageBody.setThumbnailLocalPath |
( |
String |
localPath | ) |
|
Sets the local path of the thumbnail as a string.
- Parameters
-
localPath | The local path of the thumbnail as a string. |
◆ setThumbnailLocalPath() [2/2]
void io.agora.chat.ImageMessageBody.setThumbnailLocalPath |
( |
Uri |
localPath | ) |
|
Sets the local path of the thumbnail as a URI.
- Parameters
-
localPath | The local path of the thumbnail as a URI. |
◆ setThumbnailSecret()
void io.agora.chat.ImageMessageBody.setThumbnailSecret |
( |
String |
secret | ) |
|
Sets the secret to access the thumbnail. A secret is required for verification for thumbnail download.
- Parameters
-
secret | The secret to access the thumbnail. |
◆ setThumbnailSize()
void io.agora.chat.ImageMessageBody.setThumbnailSize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
Sets the width and height of the thumbnail image.
- Parameters
-
width | The width of thumbnail. |
height | The height of thumbnail. |
◆ setThumbnailUrl()
void io.agora.chat.ImageMessageBody.setThumbnailUrl |
( |
String |
thumbnailUrl | ) |
|
Sets the URL of the thumbnail on the server.
- Parameters
-
thumbnailUrl | The URL of the thumbnail on the server. |
◆ thumbnailDownloadStatus()
Gets the download status of the thumbnail.
- Returns
- The download status of the thumbnail.
◆ thumbnailLocalPath()
String io.agora.chat.ImageMessageBody.thumbnailLocalPath |
( |
| ) |
|
Gets the local path or the URI of the thumbnail as a string.
- Returns
- The local path or the URI of the thumbnail as a string.
◆ thumbnailLocalUri()
Uri io.agora.chat.ImageMessageBody.thumbnailLocalUri |
( |
| ) |
|
Gets the local path of the thumbnail as a URI.
- Returns
- The local path of the thumbnail as a URI.
◆ CREATOR
final Parcelable.Creator<ImageMessageBody> io.agora.chat.ImageMessageBody.CREATOR |
|
static |
The documentation for this class was generated from the following file:
- io/agora/chat/ImageMessageBody.java