IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMImageElem

Public Member Functions

String getPath ()
 
List< V2TIMImagegetImageList ()
 
String toString ()
 
V2TIMElem getNextElem ()
 
void appendElem (V2TIMElem v2TIMElem)
 

Static Public Attributes

static final int V2TIM_IMAGE_TYPE_ORIGIN = 0
 
static final int V2TIM_IMAGE_TYPE_THUMB = 1
 
static final int V2TIM_IMAGE_TYPE_LARGE = 2
 

Member Function Documentation

◆ getPath()

String getPath ( )
inline

Get the local file path of the original image. This is valid only for the message sender.

Returns
Local file path

◆ getImageList()

List<V2TIMImage> getImageList ( )
inline

This can be called when elem is obtained from the SDK to get a list of images contained in elem.

Returns
List of images contained in elem

◆ toString()

String toString ( )
inline

◆ getNextElem()

V2TIMElem getNextElem ( )
inlineinherited

◆ appendElem()

void appendElem ( V2TIMElem  v2TIMElem)
inlineinherited

Add the next element

To configure multiple elements, you can add the next element via the element of a Message object after creating the Message object.

The following is the sample code for creating V2TIMTextElem and V2TIMCustomElem elements:

V2TIMMessage message = V2TIMManager.getMessageManager().createTextMessage("test");

V2TIMCustomElem customElem = new V2TIMCustomElem();

customElem.setData("Custom message".getBytes());

message.getTextElem().appendElem(customElem);

Attention
  • This API can be called only by elements of a Message object created via createMessage.
  • This API can be used to add elements only of the V2TIMTextElem, V2TIMCustomElem, V2TIMFaceElem, and V2TIMLocationElem types.

Field Documentation

◆ V2TIM_IMAGE_TYPE_ORIGIN

final int V2TIM_IMAGE_TYPE_ORIGIN = 0
static

Original image

◆ V2TIM_IMAGE_TYPE_THUMB

final int V2TIM_IMAGE_TYPE_THUMB = 1
static

Thumbnail

◆ V2TIM_IMAGE_TYPE_LARGE

final int V2TIM_IMAGE_TYPE_LARGE = 2
static

Large image