hyphenate_SDK4.0 5.0.0
hyphenate java IM SDK
 
Loading...
Searching...
No Matches
com.hyphenate.chat.EMImageMessageBody Class Reference
Inheritance diagram for com.hyphenate.chat.EMImageMessageBody:
com.hyphenate.chat.EMFileMessageBody com.hyphenate.chat.EMMessageBody

Public Member Functions

 EMImageMessageBody (File imageFile)
 
 EMImageMessageBody (Uri imageUri)
 
 EMImageMessageBody (File imageFile, File thumbnailFile)
 
 EMImageMessageBody (Uri imageLocalPath, Uri thumbnailPath)
 
 EMImageMessageBody (EMAImageMessageBody body)
 
boolean isGif ()
 
void setGif (boolean isGif)
 
String getThumbnailUrl ()
 
void setThumbnailUrl (String thumbnailUrl)
 
void setThumbnailSecret (String secret)
 
String getThumbnailSecret ()
 
void setSendOriginalImage (boolean sendOriginalImage)
 
boolean isSendOriginalImage ()
 
boolean isOriginalImage ()
 
int getWidth ()
 
int getHeight ()
 
String getFileName ()
 
String getBigImageRemoteUrl ()
 
String getBigImageLocalUrl ()
 
void setBigImageLocalUrl (String localUrl)
 
Uri getBigImageLocalUri ()
 
void setBigImageLocalUri (Uri localUri)
 
EMDownloadStatus getBigImageDownloadStatus ()
 
void setSize (int width, int height)
 
long getFileSize ()
 
String thumbnailLocalPath ()
 
Uri thumbnailLocalUri ()
 
String thumbnailDisplayName ()
 
void setThumbnailLocalPath (String localPath)
 
void setThumbnailLocalPath (Uri localPath)
 
void setThumbnailSize (int width, int height)
 
EMDownloadStatus thumbnailDownloadStatus ()
 
void setThumbnailDownloadStatus (EMDownloadStatus status)
 
- Public Member Functions inherited from com.hyphenate.chat.EMFileMessageBody
 EMFileMessageBody (String localPath)
 
 EMFileMessageBody (Uri localPath)
 
void setFileName (String fileName)
 
String getLocalUrl ()
 
void setLocalUrl (String localUrl)
 
Uri getLocalUri ()
 
void setLocalUrl (Uri localUrl)
 
String getRemoteUrl ()
 
void setRemoteUrl (String remoteUrl)
 
void setSecret (String secret)
 
String getSecret ()
 
String displayName ()
 
void setFileLength (long length)
 
EMDownloadStatus downloadStatus ()
 
void setDownloadStatus (EMDownloadStatus status)
 
- Public Member Functions inherited from com.hyphenate.chat.EMMessageBody
long operationTime ()
 
String operatorId ()
 
int operationCount ()
 

Detailed Description

The image message body class.

EMImageMessageBody body = new EMImageMessageBody(imageFile);
EMImageMessageBody(File imageFile)
Definition EMImageMessageBody.java:81

Constructor & Destructor Documentation

◆ 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
imageFileThe image message body.

◆ EMImageMessageBody() [2/5]

com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody ( Uri imageUri)

Creates an image message body with the image URI.

Parameters
imageUriThe image URI.

◆ EMImageMessageBody() [3/5]

com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody ( File imageFile,
File thumbnailFile )

Creates an image message body with an image and its thumbnail.

Parameters
imageFileThe original image file.
thumbnailFileThe 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
imageLocalPathThe original image URI.
thumbnailPathThe thumbnail image URI.

◆ EMImageMessageBody() [5/5]

com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody ( EMAImageMessageBody body)

Creates an image message body with an EMAImageMessageBody instance.

Parameters
bodyThe EMAImageMessageBody instance.

Member Function Documentation

◆ 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 ( )

Gets the image file name.

Returns
The image file name.

Reimplemented from com.hyphenate.chat.EMFileMessageBody.

◆ 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
localUriThe 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
localUrlThe 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
isGiftrue :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
sendOriginalImageWhether 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
widthThe width of the image (in pixels).
heightThe 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
statusThe download status of the thumbnail.

◆ setThumbnailLocalPath() [1/2]

void com.hyphenate.chat.EMImageMessageBody.setThumbnailLocalPath ( String localPath)

Sets the local path of the thumbnail.

Parameters
localPathThe 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
localPathThe 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
secretThe 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
widthThe width of thumbnail.
heightThe height of thumbnail.

◆ setThumbnailUrl()

void com.hyphenate.chat.EMImageMessageBody.setThumbnailUrl ( String thumbnailUrl)

Sets the URL of the thumbnail on the server.

Parameters
thumbnailUrlThe 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: