Signaling (previously RTM) SDK v1.5.0 API Reference for Android
Public Member Functions | List of all members
io.agora.rtm.RtmImageMessage Class Referenceabstract

Inherits io.agora.rtm.RtmMessage.

Public Member Functions

abstract long  getSize ()
 
abstract String  getMediaId ()
 
abstract void  setThumbnail (byte[] data)
 
abstract byte[]  getThumbnail ()
 
abstract void  setFileName (String fileName)
 
abstract String  getFileName ()
 
abstract void  setWidth (int width)
 
abstract int  getWidth ()
 
abstract void  setHeight (int height)
 
abstract int  getHeight ()
 
abstract void  setThumbnailWidth (int thumbnailWidth)
 
abstract int  getThumbnailWidth ()
 
abstract void  setThumbnailHeight (int thumbnailHeight)
 
abstract int  getThumbnailHeight ()
 
- Public Member Functions inherited from io.agora.rtm.RtmMessage
abstract void  setText (String text)
 
abstract String  getText ()
 
abstract void  setRawMessage (byte[] data)
 
abstract void  setRawMessage (byte[] data, String description)
 
abstract byte[]  getRawMessage ()
 
abstract int  getMessageType ()
 
abstract long  getServerReceivedTs ()
 
abstract boolean  isOfflineMessage ()
 

Detailed Description

The class for setting and retrieving attributes of an image message.

Member Function Documentation

◆ getSize()

abstract long io.agora.rtm.RtmImageMessage.getSize ( )
abstract

Gets the size of the uploaded image.

Returns
The size of the uploaded image in bytes.

◆ getMediaId()

abstract String io.agora.rtm.RtmImageMessage.getMediaId ( )
abstract

Gets the media ID of the uploaded image.

Note
  • The media ID is automatically populated once the file is uploaded to the file server.
  • The media ID is valid for 7 days because the Agora server keeps all uploaded images for 7 days only.
Returns
The media ID of the uploaded image.

◆ setThumbnail()

abstract void io.agora.rtm.RtmImageMessage.setThumbnail ( byte[]  data )
abstract

Sets the thumbnail of the uploaded image.

Parameters
data The thumbnail of the uploaded image.

◆ getThumbnail()

abstract byte[] io.agora.rtm.RtmImageMessage.getThumbnail ( )
abstract

Gets the thumbnail data of the uploaded image.

Returns
The thumbnail data of the uploaded image.

◆ setFileName()

abstract void io.agora.rtm.RtmImageMessage.setFileName ( String  fileName )
abstract

Sets the filename of the uploaded image.

Parameters
fileName The filename of the uploaded image. The total size of thumbnail and fileName must not exceed 32 KB.

◆ getFileName()

abstract String io.agora.rtm.RtmImageMessage.getFileName ( )
abstract

Gets the filename of the uploaded image.

Returns
The filename of the uploaded image.

◆ setWidth()

abstract void io.agora.rtm.RtmImageMessage.setWidth ( int  width )
abstract

Sets the width of the uploaded image.

Note
  • If the uploaded image is in JPG, JPEG, BMP, or PNG format, the SDK automatically calculates the width and height of the image. You can call getWidth directly to get the width of the image.
  • Image width that is set by calling this method overrides the width calculated by the SDK.
Parameters
width The width of the uploaded image.

◆ getWidth()

abstract int io.agora.rtm.RtmImageMessage.getWidth ( )
abstract

Gets the width of the uploaded image.

Note
  • If the uploaded image is in JPG, JPEG, BMP, or PNG format, the SDK automatically calculates the width and height of the image. You can call this method directly to get the width of the image.
  • Image width that is set by calling setWidth overrides the width calculated by the SDK.
Returns
The width of the uploaded image. Returns 0 if the SDK does not support the format of the uploaded image.

◆ setHeight()

abstract void io.agora.rtm.RtmImageMessage.setHeight ( int  height )
abstract

Sets the height of the uploaded image.

Note
  • If the uploaded image is in JPG, JPEG, BMP, or PNG format, the SDK automatically calculates the width and height of the image. You can call getHeight directly to get the height of the image.
  • Image height that is set by calling this method overrides the height calculated by the SDK.
Parameters
height The height of the uploaded image. Returns 0 if the SDK does not support the format of the uploaded image.

◆ getHeight()

abstract int io.agora.rtm.RtmImageMessage.getHeight ( )
abstract

Gets the height of the uploaded image.

Note
  • If the uploaded image is in JPG, JPEG, BMP, or PNG format, the SDK automatically calculates the width and height of the image. You can call this method directly to get the height of the image.
  • Image height that is set by calling setHeight overrides the height calculated by the SDK.
Returns
The height of the uploaded image.

◆ setThumbnailWidth()

abstract void io.agora.rtm.RtmImageMessage.setThumbnailWidth ( int  thumbnailWidth )
abstract

Sets the width of the thumbnail.

Note
You need to calculate the width of the thumbnail by yourself, because the SDK does not calculate the value for you.
Parameters
thumbnailWidth the The width of the thumbnail.

◆ getThumbnailWidth()

abstract int io.agora.rtm.RtmImageMessage.getThumbnailWidth ( )
abstract

Gets the width of the thumbnail.

Returns
The width of the thumbnail.

◆ setThumbnailHeight()

abstract void io.agora.rtm.RtmImageMessage.setThumbnailHeight ( int  thumbnailHeight )
abstract

Sets the height of the thumbnail.

Note
You need to calculate the height of the thumbnail by yourself, because the SDK does not calculate the value for you.
Parameters
thumbnailHeight The height of the thumbnail.

◆ getThumbnailHeight()

abstract int io.agora.rtm.RtmImageMessage.getThumbnailHeight ( )
abstract

Gets the height of the thumbnail.

Returns
The height of the thumbnail.