hyphenate_SDK3.0  3.8.6.1
hyphenate java IM SDK
Public 成员函数 | 静态 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)
 
String toString ()
 
int describeContents ()
 
void writeToParcel (Parcel dest, int flags)
 
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 ()
 
- Public 成员函数 继承自 com.hyphenate.chat.EMFileMessageBody
 EMFileMessageBody (String localPath)
 
 EMFileMessageBody (Uri localPath)
 
 EMFileMessageBody (EMAFileMessageBody body)
 
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 属性

static final Parcelable.Creator< EMImageMessageBodyCREATOR
 

详细描述

图片消息体

    EMImageMessageBody body = new EMImageMessageBody(imageFile);

构造及析构函数说明

◆ EMImageMessageBody() [1/4]

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

创建一个图片消息体

参数
imageFile图片文件

◆ EMImageMessageBody() [2/4]

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

创建一个图片消息体

参数
imageUri图片的资源标识符

◆ EMImageMessageBody() [3/4]

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

创建一个图片消息体,包含附件和缩略图

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

◆ EMImageMessageBody() [4/4]

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

创建一个图片消息体,包含附件和缩略图

参数
imageLocalPath图片uri
thumbnailPath缩略图uri

成员函数说明

◆ 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),接受消息时, 接收方会自动根据thumbnailRemotePath下载缩略图,存储到本地

返回
缩略图的服务器地址

◆ getWidth()

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

获取图片的宽度

返回
图片的宽度

◆ isSendOriginalImage()

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

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

返回
是否发送原图

◆ setSendOriginalImage()

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

设置发送图片时,是否发送原图,默认是发送压缩过后的图(图片超过100k会被压缩)

参数
sendOriginalImage是否发送原图

◆ setThumbnailLocalPath() [1/2]

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

设置缩略图本地路径

参数
localPath设置缩略图的本地路径

◆ setThumbnailLocalPath() [2/2]

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

设置缩略图本地路径

参数
localPath设置缩略图的本地路径

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

获取缩略图的下载状态

返回
EMDownloadStatus

◆ thumbnailLocalPath()

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

获取缩略图本地路径或者资源标识符的字符串类型

返回
缩略图本地路径或者资源标识符的字符串类型

◆ thumbnailLocalUri()

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

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

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

类成员变量说明

◆ CREATOR

final Parcelable.Creator<EMImageMessageBody> com.hyphenate.chat.EMImageMessageBody.CREATOR
static
初始值:
= new Parcelable.Creator<EMImageMessageBody>() {
public EMImageMessageBody createFromParcel(Parcel in) {
return new EMImageMessageBody(in);
}
public EMImageMessageBody[] newArray(int size) {
return new EMImageMessageBody[size];
}
}
EMImageMessageBody(File imageFile)
Definition: EMImageMessageBody.java:54

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