The image message body class.
EMImageMessageBody(File imageFile)
Definition EMImageMessageBody.java:81
◆ EMImageMessageBody() [1/5]
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody |
( |
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. |
◆ EMImageMessageBody() [2/5]
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody |
( |
Uri | imageUri | ) |
|
Creates an image message body with the image URI.
- Parameters
-
◆ EMImageMessageBody() [3/5]
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody |
( |
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. |
◆ EMImageMessageBody() [4/5]
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody |
( |
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. |
◆ EMImageMessageBody() [5/5]
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody |
( |
EMAImageMessageBody | body | ) |
|
Creates an image message body with an EMAImageMessageBody instance.
- Parameters
-
| body | The EMAImageMessageBody instance. |
◆ getBigImageDownloadStatus()
| EMDownloadStatus com.hyphenate.chat.EMImageMessageBody.getBigImageDownloadStatus |
( |
| ) |
|
Gets the download status of the large image.
- Returns
- The download status of the large image.
◆ getBigImageLocalUri()
| Uri com.hyphenate.chat.EMImageMessageBody.getBigImageLocalUri |
( |
| ) |
|
Gets the local URI string of the large image.
- Returns
- The local URI string of the large image.
◆ getBigImageLocalUrl()
| String com.hyphenate.chat.EMImageMessageBody.getBigImageLocalUrl |
( |
| ) |
|
Gets the local path or the URI string of the large image.
- Returns
- The local path or the URI string of the large image.
◆ getBigImageRemoteUrl()
| String com.hyphenate.chat.EMImageMessageBody.getBigImageRemoteUrl |
( |
| ) |
|
Gets the remote URL of the large image on the server.
- Returns
- The remote URL of the large image.
◆ getFileName()
| String com.hyphenate.chat.EMImageMessageBody.getFileName |
( |
| ) |
|
◆ getFileSize()
| long com.hyphenate.chat.EMImageMessageBody.getFileSize |
( |
| ) |
|
Gets the size of the image file.
- Returns
- The size of the image file.
◆ getHeight()
| int com.hyphenate.chat.EMImageMessageBody.getHeight |
( |
| ) |
|
Gets the image height.
- Returns
- The image height.
◆ getThumbnailSecret()
| String com.hyphenate.chat.EMImageMessageBody.getThumbnailSecret |
( |
| ) |
|
Gets the secret to access the thumbnail. A secret is required for verification for thumbnail download.
- Returns
- The secret to access the thumbnail.
- Deprecated
- Deprecated. Use
getSecret() instead.
◆ getThumbnailUrl()
| String com.hyphenate.chat.EMImageMessageBody.getThumbnailUrl |
( |
| ) |
|
Gets the URL of the thumbnail on the server.
If EMOptions#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 com.hyphenate.chat.EMImageMessageBody.getWidth |
( |
| ) |
|
Gets the image width.
- Returns
- The image width.
◆ isGif()
| boolean com.hyphenate.chat.EMImageMessageBody.isGif |
( |
| ) |
|
Whether the image is a gif image.
- Returns
- true :is gif image false :not gif image.
-
◆ isOriginalImage()
| boolean com.hyphenate.chat.EMImageMessageBody.isOriginalImage |
( |
| ) |
|
For the sender: this value indicates whether to send the original image when sending an image; For the receiver: this value indicates whether the URL returned by {@EMFileMessageBodygetRemoteUrl()} points to the original image resource or the compressed image resource sent by the sender.
- Returns
- Whether it is the original image.
- (Default)
false: For the sender: indicates that the compressed image is sent (image compression rule: the shorter side is no more than 720px, and the quality is compressed to 85%); For the receiver: indicates that the URL returned by {@EMFileMessageBodygetRemoteUrl()} points to the compressed image resource sent by the sender.
true: For the sender: indicates that the original image is sent; For the receiver: indicates that the URL returned by {@EMFileMessageBodygetRemoteUrl()} points to the original image resource.
Gets whether the image is the original one.
- Sender: Indicates whether to send the original image.
- Recipient: Indicates whether
EMFileMessageBody#getRemoteUrl() returns the URL of the original image or the compressed one.
- Returns
- Whether it is the original image.
- (Default)
false : The sender sends a large image that is a compressed image (Compression rules: the shorter edge is limited to 720px, and the quality is reduced to 85%). For the recipient, EMFileMessageBody#getRemoteUrl() returns the URL the compressed image resource.
true: The sender sends the original image. For the recipient, EMFileMessageBody#getRemoteUrl() returns the URL of the original image.
◆ isSendOriginalImage()
| boolean com.hyphenate.chat.EMImageMessageBody.isSendOriginalImage |
( |
| ) |
|
Gets whether to send the original image.
- Returns
- Whether to send the original image.
- (Default)
false: Send the thumbnail(image compression rule: the shorter side is no more than 720px, and the quality is compressed to 85%);
true: Send the original image.
- Deprecated
- Deprecated. Use
isOriginalImage() instead.
◆ setBigImageLocalUri()
| void com.hyphenate.chat.EMImageMessageBody.setBigImageLocalUri |
( |
Uri | localUri | ) |
|
Sets the local URI string of the large image.
- Parameters
-
| localUri | The local URI string of the large image. |
◆ setBigImageLocalUrl()
| void com.hyphenate.chat.EMImageMessageBody.setBigImageLocalUrl |
( |
String | localUrl | ) |
|
Sets the local path or the URI string of the large image.
- Parameters
-
| localUrl | The local path or the URI string of the large image. |
◆ setGif()
| void com.hyphenate.chat.EMImageMessageBody.setGif |
( |
boolean | isGif | ) |
|
Set whether the image is a Gif.
- Parameters
-
| isGif | true :is gif image false :not gif image. |
◆ setSendOriginalImage()
| void com.hyphenate.chat.EMImageMessageBody.setSendOriginalImage |
( |
boolean | sendOriginalImage | ) |
|
Sets whether to send the original image.
This setting is invalid for GIF images that are always sent as original images.
- Parameters
-
| sendOriginalImage | Whether to send the original image.
- (Default)
false: Sends a large image that is a compressed image (Compression rules: the shorter edge is limited to 720px, and the quality is reduced to 85%).
true: Sends the original image.
|
◆ setSize()
| void com.hyphenate.chat.EMImageMessageBody.setSize |
( |
int | width, |
|
|
int | height ) |
Sets the width and height of the image.
- Parameters
-
| width | The width of the image (in pixels). |
| height | The height of the image (in pixels). |
◆ setThumbnailDownloadStatus()
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailDownloadStatus |
( |
EMDownloadStatus | status | ) |
|
Sets the download status of the thumbnail in the local database.
- Parameters
-
| status | The download status of the thumbnail. |
◆ setThumbnailLocalPath() [1/2]
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailLocalPath |
( |
String | localPath | ) |
|
Sets the local path of the thumbnail.
- Parameters
-
| localPath | The local path of the thumbnail. |
◆ setThumbnailLocalPath() [2/2]
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailLocalPath |
( |
Uri | localPath | ) |
|
Sets the local URI string of the thumbnail.
- Parameters
-
| localPath | The local URI string of the thumbnail. |
◆ setThumbnailSecret()
| void com.hyphenate.chat.EMImageMessageBody.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. |
- Deprecated
- Deprecated. Use
setSecret(String) instead.
◆ setThumbnailSize()
| void com.hyphenate.chat.EMImageMessageBody.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 com.hyphenate.chat.EMImageMessageBody.setThumbnailUrl |
( |
String | thumbnailUrl | ) |
|
Sets the URL of the thumbnail on the server.
- Parameters
-
| thumbnailUrl | The URL of the thumbnail on the server. |
◆ thumbnailDisplayName()
| String com.hyphenate.chat.EMImageMessageBody.thumbnailDisplayName |
( |
| ) |
|
Gets the display name of the thumbnail.
- Returns
- The display name of the thumbnail.
◆ thumbnailDownloadStatus()
| EMDownloadStatus com.hyphenate.chat.EMImageMessageBody.thumbnailDownloadStatus |
( |
| ) |
|
Gets the download status of the thumbnail.
- Returns
- The download status of the thumbnail.
◆ thumbnailLocalPath()
| String com.hyphenate.chat.EMImageMessageBody.thumbnailLocalPath |
( |
| ) |
|
Gets the local path or the URI string of the thumbnail.
- Returns
- The local path or the URI string of the thumbnail.
◆ thumbnailLocalUri()
| Uri com.hyphenate.chat.EMImageMessageBody.thumbnailLocalUri |
( |
| ) |
|
Gets the local URI string of the thumbnail.
- Returns
- The local URI string of the thumbnail.
The documentation for this class was generated from the following file:
- com/hyphenate/chat/EMImageMessageBody.java