|
hyphenate_SDK4.0 4.19.0
hyphenate java IM SDK
|
Public 成员函数 | |
| 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 () |
| int | getWidth () |
| int | getHeight () |
| String | getFileName () |
| 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) |
图片消息体类。
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody | ( | File | imageFile | ) |
用图片文件创建一个图片消息体。 参考:一共有五种图片消息体生成的方式:
要求传入的参数是一个图片文件:
EMAImageMessageBody 类型的实例:| imageFile | 图片消息体。 |
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody | ( | Uri | imageUri | ) |
传入图片的 URI 创建一个图片消息体。
| imageUri | 图片的 URI。 |
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody | ( | File | imageFile, |
| File | thumbnailFile ) |
传入图片附件和缩略图文件创建一个图片消息体。
| imageFile | 图片文件。 |
| thumbnailFile | 缩略图文件。 |
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody | ( | Uri | imageLocalPath, |
| Uri | thumbnailPath ) |
传入图片附件和缩略图的 URI 创建一个图片消息体。
| imageLocalPath | 图片 URI,即图片的资源标识符。 |
| thumbnailPath | 缩略图 URI,即缩略图的资源标识符。 |
| com.hyphenate.chat.EMImageMessageBody.EMImageMessageBody | ( | EMAImageMessageBody | body | ) |
基于 EMAImageMessageBody 类型的实例创建一个图片消息体。
| body | EMAImageMessageBody 类型的实例。 |
| String com.hyphenate.chat.EMImageMessageBody.getFileName | ( | ) |
| long com.hyphenate.chat.EMImageMessageBody.getFileSize | ( | ) |
获取图片文件大小。
| int com.hyphenate.chat.EMImageMessageBody.getHeight | ( | ) |
获取图片的高度。
| String com.hyphenate.chat.EMImageMessageBody.getThumbnailSecret | ( | ) |
获取缩略图的访问密钥。下载缩略图时用户需要提供密钥进行校验。
| String com.hyphenate.chat.EMImageMessageBody.getThumbnailUrl | ( | ) |
获取缩略图的服务器地址。
如果设置了 EMOptions#setAutoDownloadThumbnail(boolean),接收消息时 SDK 会自动根据 thumbnailRemotePath 下载缩略图,存储到本地。
| int com.hyphenate.chat.EMImageMessageBody.getWidth | ( | ) |
获取图片的宽度。
| boolean com.hyphenate.chat.EMImageMessageBody.isGif | ( | ) |
是否是gif类型图片。
| boolean com.hyphenate.chat.EMImageMessageBody.isSendOriginalImage | ( | ) |
获取发送图片时,是否发送原图。
false:表示发送缩略图,图片超过 100 KB 会被压缩。true:表示发送原图。 | void com.hyphenate.chat.EMImageMessageBody.setGif | ( | boolean | isGif | ) |
设置图片是否是Gif类型。
| isGif | true :是gif类型图片 false : 不是gif类型图片。 |
| void com.hyphenate.chat.EMImageMessageBody.setSendOriginalImage | ( | boolean | sendOriginalImage | ) |
设置发送图片时,是否发送原图。该设置对Gif图片无效。Gif只支持发送原图。
| sendOriginalImage | 是否发送原图。
|
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailDownloadStatus | ( | EMDownloadStatus | status | ) |
设置本地数据库缩略图的下载状态。
| status | 缩略图的下载状态。 |
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailLocalPath | ( | String | localPath | ) |
用字符串形式设置缩略图本地路径。
| localPath | 用字符串形式设置缩略图的本地路径。 |
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailLocalPath | ( | Uri | localPath | ) |
用 URI 的格式设置缩略图本地路径。
| localPath | 用 URI 的格式设置缩略图的本地路径。 |
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailSecret | ( | String | secret | ) |
设置访问缩略图的密钥。下载缩略图时用户需要提供密钥进行校验。
| secret | 缩略图的访问密钥。 |
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailSize | ( | int | width, |
| int | height ) |
设置缩略图的尺寸。
| width | 缩略图的宽度。 |
| height | 缩略图的高度。 |
| void com.hyphenate.chat.EMImageMessageBody.setThumbnailUrl | ( | String | thumbnailUrl | ) |
设置缩略图的服务器路径。
| thumbnailUrl | 缩略图的服务器路径。 |
| String com.hyphenate.chat.EMImageMessageBody.thumbnailDisplayName | ( | ) |
获取缩略图的显示名称。
| EMDownloadStatus com.hyphenate.chat.EMImageMessageBody.thumbnailDownloadStatus | ( | ) |
获取缩略图的下载状态。
| String com.hyphenate.chat.EMImageMessageBody.thumbnailLocalPath | ( | ) |
获取缩略图的本地路径或者字符串形式的资源标识符。
| Uri com.hyphenate.chat.EMImageMessageBody.thumbnailLocalUri | ( | ) |
获取缩略图本地资源标识符(路径)。