com.tencent.mm.sdk.modelmsg
Class WXImageObject

java.lang.Object
  extended by com.tencent.mm.sdk.modelmsg.WXImageObject
All Implemented Interfaces:
WXMediaMessage.IMediaObject

public class WXImageObject
extends java.lang.Object
implements WXMediaMessage.IMediaObject

Derived class of WXMediaMessage.IMediaObject. Used to describe an image object

NOTE: imageData and imagePath can not be null at the same time.

imageData and imagePath will not be used at the same time.

WXMediaMessage.IMediaObject的派生类,用于描述一个图片对象

注意:imageData和imagePath不能同时为空

imageData和imagePath不会同时被使用


Field Summary
 byte[] imageData
          
Binary data of an image

NOTE: Content size should be within 10MB

图片的二进制数据

注意:内容大小不超过10MB

 java.lang.String imagePath
          
Local directory of an image

NOTE: The length should be within 10KB and content size within 10MB.

 
Fields inherited from interface com.tencent.mm.sdk.modelmsg.WXMediaMessage.IMediaObject
TYPE_APPDATA, TYPE_EMOJI, TYPE_FILE, TYPE_IMAGE, TYPE_MUSIC, TYPE_PRODUCT, TYPE_TEXT, TYPE_UNKNOWN, TYPE_URL, TYPE_VIDEO
 
Constructor Summary
WXImageObject()
           
WXImageObject(Bitmap bm)
          
Create an object via bitmap
通过位图创建一个对象
WXImageObject(byte[] bitmap)
          
Constructor
构造函数
 
Method Summary
 boolean checkArgs()
          
Check validity of parameters of MediaObject
检查该MediaObject各个参数的合法性
 void serialize(Bundle data)
          
Serialize member variables to bundle object
将成员变量序列化到bundle对象中
 void setImagePath(java.lang.String imagePath)
           
 int type()
          
Load type of the current media object
获取当前媒体对象的类型
 void unserialize(Bundle data)
          
Deserialize bundle object to initialize member variables
通过反序列化bundle对象初始化成员变量
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageData

public byte[] imageData
Binary data of an image

NOTE: Content size should be within 10MB

图片的二进制数据

注意:内容大小不超过10MB


imagePath

public java.lang.String imagePath
Local directory of an image

NOTE: The length should be within 10KB and content size within 10MB.

图片的本地路径

注意:长度不超过10KB,内容大小不超过10MB

Constructor Detail

WXImageObject

public WXImageObject()

WXImageObject

public WXImageObject(byte[] bitmap)
Constructor
构造函数

Parameters:
bitmap -
Binary data of a bitmap. Used to create a new object.
位图的二级制数据,用于创建一个对象

WXImageObject

public WXImageObject(Bitmap bm)
Create an object via bitmap
通过位图创建一个对象

Method Detail

setImagePath

public void setImagePath(java.lang.String imagePath)

serialize

public void serialize(Bundle data)
Description copied from interface: WXMediaMessage.IMediaObject
Serialize member variables to bundle object
将成员变量序列化到bundle对象中

Specified by:
serialize in interface WXMediaMessage.IMediaObject
Parameters:
data -
Target bundle object
目标bundle对象

unserialize

public void unserialize(Bundle data)
Description copied from interface: WXMediaMessage.IMediaObject
Deserialize bundle object to initialize member variables
通过反序列化bundle对象初始化成员变量

Specified by:
unserialize in interface WXMediaMessage.IMediaObject
Parameters:
data -
Data source bundle object
数据源bundle对象

type

public int type()
Description copied from interface: WXMediaMessage.IMediaObject
Load type of the current media object
获取当前媒体对象的类型

Specified by:
type in interface WXMediaMessage.IMediaObject
Returns:
type
Type of the current media object
当前媒体对象的类型

checkArgs

public boolean checkArgs()
Description copied from interface: WXMediaMessage.IMediaObject
Check validity of parameters of MediaObject
检查该MediaObject各个参数的合法性

Specified by:
checkArgs in interface WXMediaMessage.IMediaObject
Returns:
True if all parameters are valid.
如果参数均合法,返回true