hyphenate_SDK4.0 4.6.0
hyphenate java IM SDK
Public 成员函数 | 所有成员列表
com.hyphenate.chat.EMImageMessageBody类 参考
类 com.hyphenate.chat.EMImageMessageBody 继承关系图:
com.hyphenate.chat.EMFileMessageBody com.hyphenate.chat.EMMessageBody

Public 成员函数

 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 成员函数 继承自 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 成员函数 继承自 com.hyphenate.chat.EMMessageBody
long operationTime ()
 
String operatorId ()
 
int operationCount ()
 

详细描述

图片消息体类。

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

构造及析构函数说明

◆ EMImageMessageBody() [1/5]

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

用图片文件创建一个图片消息体。 参考:一共有五种图片消息体生成的方式:

要求传入的参数是一个图片文件:

参数
imageFile图片消息体。

◆ EMImageMessageBody() [2/5]

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

传入图片的 URI 创建一个图片消息体。

参数
imageUri图片的 URI。

◆ EMImageMessageBody() [3/5]

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

传入图片附件和缩略图文件创建一个图片消息体。

参数
imageFile图片文件。
thumbnailFile缩略图文件。

◆ EMImageMessageBody() [4/5]

com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody ( Uri  imageLocalPath,
Uri  thumbnailPath 
)

传入图片附件和缩略图的 URI 创建一个图片消息体。

参数
imageLocalPath图片 URI,即图片的资源标识符。
thumbnailPath缩略图 URI,即缩略图的资源标识符。

◆ EMImageMessageBody() [5/5]

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

基于 EMAImageMessageBody 类型的实例创建一个图片消息体。

参数
bodyEMAImageMessageBody 类型的实例。

成员函数说明

◆ getFileName()

String com.hyphenate.chat.EMImageMessageBody.getFileName ( )

获取图片文件名字。

返回
图片文件名字。

重载 com.hyphenate.chat.EMFileMessageBody .

◆ getFileSize()

long com.hyphenate.chat.EMImageMessageBody.getFileSize ( )

获取图片文件大小。

返回
图片文件大小。

◆ getHeight()

int com.hyphenate.chat.EMImageMessageBody.getHeight ( )

获取图片的高度。

返回
图片的高度。

◆ getThumbnailSecret()

String com.hyphenate.chat.EMImageMessageBody.getThumbnailSecret ( )

获取缩略图的访问密钥。下载缩略图时用户需要提供密钥进行校验。

返回
缩略图的访问密钥。

◆ getThumbnailUrl()

String com.hyphenate.chat.EMImageMessageBody.getThumbnailUrl ( )

获取缩略图的服务器地址。

如果设置了 EMOptions#setAutoDownloadThumbnail(boolean),接收消息时 SDK 会自动根据 thumbnailRemotePath 下载缩略图,存储到本地。

返回
缩略图的服务器地址。

◆ getWidth()

int com.hyphenate.chat.EMImageMessageBody.getWidth ( )

获取图片的宽度。

返回
图片的宽度。

◆ isSendOriginalImage()

boolean com.hyphenate.chat.EMImageMessageBody.isSendOriginalImage ( )

获取发送图片时,是否发送原图。

返回
是否发送原图。
  • (默认)false:表示发送缩略图,图片超过 100k 会被压缩。
  • true表示发送原图。

◆ setSendOriginalImage()

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

设置发送图片时,是否发送原图。

参数
sendOriginalImage是否发送原图。
  • (默认)false:表示发送缩略图,图片超过 100k 会被压缩。
  • true表示发送原图。

◆ setThumbnailDownloadStatus()

void com.hyphenate.chat.EMImageMessageBody.setThumbnailDownloadStatus ( EMDownloadStatus  status)

设置本地数据库缩略图的下载状态。

参数
status缩略图的下载状态。

◆ setThumbnailLocalPath() [1/2]

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

用字符串形式设置缩略图本地路径。

参数
localPath用字符串形式设置缩略图的本地路径。

◆ setThumbnailLocalPath() [2/2]

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

用 URI 的格式设置缩略图本地路径。

参数
localPath用 URI 的格式设置缩略图的本地路径。

◆ setThumbnailSecret()

void com.hyphenate.chat.EMImageMessageBody.setThumbnailSecret ( String  secret)

设置访问缩略图的密钥。下载缩略图时用户需要提供密钥进行校验。

参数
secret缩略图的访问密钥。

◆ setThumbnailSize()

void com.hyphenate.chat.EMImageMessageBody.setThumbnailSize ( int  width,
int  height 
)

设置缩略图的尺寸。

参数
width缩略图的宽度。
height缩略图的高度。

◆ setThumbnailUrl()

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

设置缩略图的服务器路径。

参数
thumbnailUrl缩略图的服务器路径。

◆ thumbnailDownloadStatus()

EMDownloadStatus com.hyphenate.chat.EMImageMessageBody.thumbnailDownloadStatus ( )

获取缩略图的下载状态。

返回
缩略图的下载状态。

◆ thumbnailLocalPath()

String com.hyphenate.chat.EMImageMessageBody.thumbnailLocalPath ( )

获取缩略图的本地路径或者字符串形式的资源标识符。

返回
缩略图本地路径或者字符串形式的资源标识符。

◆ thumbnailLocalUri()

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

获取缩略图本地资源标识符(路径)。

返回
缩略图本地资源标识符(路径)。

该类的文档由以下文件生成: