1 package com.netease.nimlib.sdk.msg.attachment;
7 import org.json.JSONObject;
73 return MsgHelper.getThumbUrl(
this,
getUrl());
82 return NimStorageType.TYPE_IMAGE;
85 private static final String KEY_WIDTH =
"w";
86 private static final String KEY_HEIGHT =
"h";
89 protected void save(JSONObject json) {
90 JSONHelper.put(json, KEY_WIDTH, width);
91 JSONHelper.put(json, KEY_HEIGHT, height);
95 protected void load(JSONObject json) {
96 width = JSONHelper.getInt(json, KEY_WIDTH);
97 height = JSONHelper.getInt(json, KEY_HEIGHT);
String getUrl()
获取文件在服务器上的下载url。若文件还未上传,返回null
void save(JSONObject json)
void setWidth(int width)
设置图片宽度
ImageAttachment(String attach)
void load(JSONObject json)
String getThumbUrl()
获取缩略图 thumbUrl
NimStorageType storageType()
void setHeight(int height)
设置图片高度