eZIPSDK For android¶
思澈 安卓 eZipSDK
1.集成¶
1.1 Gradle拉取配置¶
allprojects {
repositories {
maven {
url 'https://maven.aliyun.com/repository/public'
}
maven {
credentials {
username '65a890ad4f41789f56425965'
password 'Y-kxYEyTl5)['
}
url 'https://packages.aliyun.com/maven/repository/2457536-release-P0YgD8/'
}
}
}
1.2 sdk集成¶
implementation 'com.sifli:sifliezipsdk:2.4.3'
2.接口定义¶
/**
* transform png data to ezip bin, support gif to apng
* @param pngData png or gif data
* @param colorType color type as below: rgb565, rgb565A, rbg888, rgb888A
* @param ezip_color_type
* 0 keep original alpha channel
* 1 no alpha channel
* @param ezip_bin_type
* set 0 to support rotation
* set 1 for no rotation
* @param boardType
* 0: 55x
* 1: 56x
* 2: 52x
* @return ezip or apng result, null for fail
*/
public static synchronized byte[] pngToEzip(byte[] pngData, String colorType,
int ezip_color_type, int ezip_bin_type, int boardType)
序列帧
/**
* Convert a set of png images
* @param pngData png data as arraylist, will be converted in the order of the images in the arraylist
* @param colorType color type as below: rgb565, rgb565A, rbg888, rgb888A
* @param ezip_color_type
* 0 keep original alpha channel
* 1 no alpha channel
* @param ezip_bin_type
* set 0 to support rotation
* set 1 for no rotation
* @param boardType
* 0: 55x
* 1: 56x
* 2: 52x
* @param interval 动画间隔 0 默认间隔
* @return ezip or apng result, null for fail
*/
public static synchronized byte[] pngToEzipSequence(ArrayList<byte[]> pngData, String colorType,
int ezip_color_type, int ezip_bin_type, int boardType,int interval)
3.使用¶
byte[] result = sifliEzipUtil.pngToEzip(imageData, "RGB565A", 0, 1, 1);