ShengwangChatSDK 1.3.2
构造函数 | 属性 | 所有成员列表
AgoraChatImageMessageBody类 参考

#import <AgoraChatImageMessageBody.h>

类 AgoraChatImageMessageBody 继承关系图:
AgoraChatFileMessageBody AgoraChatMessageBody

构造函数

(instancetype) - initWithData:thumbnailData:
 
- 构造函数 继承自 AgoraChatFileMessageBody
(instancetype _Nonnull) - initWithLocalPath:displayName:
 
(instancetype _Nonnull) - initWithData:displayName:
 
- 构造函数 继承自 AgoraChatMessageBody
(instancetype _Nonnull) - NS_UNAVAILABLE
 

属性

CGSize size
 
CGFloat compressionRatio
 
NSString * thumbnailDisplayName
 
NSString * thumbnailLocalPath
 
NSString * thumbnailRemotePath
 
NSString * thumbnailSecretKey
 
CGSize thumbnailSize
 
long long thumbnailFileLength
 
AgoraChatDownloadStatus thumbnailDownloadStatus
 
- 属性 继承自 AgoraChatFileMessageBody
NSString * displayName
 
NSString * localPath
 
NSString * remotePath
 
NSString * secretKey
 
long long fileLength
 
AgoraChatDownloadStatus downloadStatus
 
- 属性 继承自 AgoraChatMessageBody
AgoraChatMessageBodyType type
 
NSUInteger operationTime
 
NSString * operatorId
 
NSUInteger operatorCount
 

详细描述

@header AgoraChatImageMessageBody.h @abstract Image message body class

作者
Hyphenate
版本
3.00 The image message body.

You can create an image message body by calling one of the following methods:

-(instancetype)initWithData:displayName: -(instancetype)initWithData:thumbnailData:

Note: SDK will compress the image based on the attribute compressRatio when delivering the image.

函数文档

◆ initWithData:thumbnailData:

- (instancetype) initWithData: (NSData *)  aData
thumbnailData: (NSData *)  aThumbnailData 

Initializes an image message body instance.

The image receiver will receive object thumbnail that generated based on sender's aData object.

Adjusts thumbnail resolution on Hyphenate console -> "Thumbnail Size" -> width and height. Unit in px. ex. aData resolution 200 x 400 (1:2), thumbnail resolution setting (width x height) 200 x 200, then will generate thumbnail in 100 x 200 ex. aData resolution 600 x 300 (2:1), thumbnail resolution setting (width x height) 200 x 200, then will generate thumbnail in 200 x 100

The image sender can obtain thumbnail from thumbnailLocalPath.

The image receiver will get thumbnail stored under thumbnailRemotePath after a successful download automatically. However, if the automatic downloading failed, use the following method, downloadMessageThumbnail:progress:completion:

参数
aDataThe original image object in NSData format.
aThumbnailDataThe thumbnail in NSData format. Will not push to server, but only for local usage.
返回
An image message body instance.

属性说明

◆ compressionRatio

- (CGFloat) compressionRatio
readwritenonatomicassign

The compression ratio of the image file.

When sending the image message, the SDK compresses the image file according to the value of this parameter. The value range is (0.0, 1.0], and the default value is 0.6. 1.0 means that the SDK does not compress the image file, and 0.6 means that the SDK compresses the file size to 60% of the original. If you set this parameter to a value lower than 0 (included), the SDK uses the default value.

◆ size

- (CGSize) size
readwritenonatomicassign

The resolution of the image.

◆ thumbnailDisplayName

- (NSString*) thumbnailDisplayName
readwritenonatomiccopy

The display name of thumbnail.

◆ thumbnailDownloadStatus

- (AgoraChatDownloadStatus) thumbnailDownloadStatus
readwritenonatomicassign

The download status of the thumbnail.

◆ thumbnailFileLength

- (long long) thumbnailFileLength
readwritenonatomicassign

The data length (bytes) of the thumbnail file.

◆ thumbnailLocalPath

- (NSString*) thumbnailLocalPath
readwritenonatomiccopy

The local path of the thumbnail. UIImage *image = [UIImage imageWithContentsOfFile:thumbnailLocalPath];

◆ thumbnailRemotePath

- (NSString*) thumbnailRemotePath
readwritenonatomiccopy

The URL path of the thumbnail of the server.

The message receiver gets the thumbnail with this member.

◆ thumbnailSecretKey

- (NSString*) thumbnailSecretKey
readwritenonatomiccopy

The secret key for the thumbnail. A key is required for verification when downloading thumbnail.

◆ thumbnailSize

- (CGSize) thumbnailSize
readwritenonatomicassign

The resolution of the thumbnail file.


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