hyphenate_SDK4.0 4.8.0
hyphenate java IM SDK
Public Member Functions | List of all members
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)
 
String getThumbnailUrl ()
 
void setThumbnailUrl (String thumbnailUrl)
 
void setThumbnailSecret (String secret)
 
String getThumbnailSecret ()
 
void setSendOriginalImage (boolean sendOriginalImage)
 
boolean isSendOriginalImage ()
 
int getWidth ()
 
int getHeight ()
 
String getFileName ()
 
long getFileSize ()
 
String thumbnailLocalPath ()
 
Uri thumbnailLocalUri ()
 
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

◆ 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.

◆ 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.

◆ 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 with size larger than 100k will be compressed);
  • true: Send the original image.

◆ setSendOriginalImage()

void com.hyphenate.chat.EMImageMessageBody.setSendOriginalImage ( boolean  sendOriginalImage)

Sets whether to send the original image when sending an image.

Parameters
sendOriginalImageWhether to send the original image. -(Default)false: Send the thumbnail(image with size larger than 100k will be compressed);
  • true: Send the original image.

◆ 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 as a string.

Parameters
localPathThe local path of the thumbnail as a string.

◆ setThumbnailLocalPath() [2/2]

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

Sets the local path of the thumbnail as a URI.

Parameters
localPathThe local path of the thumbnail as a URI.

◆ 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.

◆ 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.

◆ 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 of the thumbnail as a string.

Returns
The local path or the URI of the thumbnail as a string.

◆ thumbnailLocalUri()

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

Gets the local path of the thumbnail as a URI.

Returns
The local path of the thumbnail as a URI.

The documentation for this class was generated from the following file: