IOS GIF图片解析 将gif图片解析成image数组
来源:互联网 发布:大数据分析工作 编辑:程序博客网 时间:2024/06/08 15:22
+ (NSMutableArray *)praseGIFDataToImageArray:(NSData *)data; { NSMutableArray *frames = [[NSMutableArray alloc] init]; CGImageSourceRef src = CGImageSourceCreateWithData((CFDataRef)data, NULL); CGFloat animationTime = 0.f; if (src) { size_t l = CGImageSourceGetCount(src); frames = [NSMutableArray arrayWithCapacity:l]; for (size_t i = 0; i < l; i++) { CGImageRef img = CGImageSourceCreateImageAtIndex(src, i, NULL); NSDictionary *properties = (NSDictionary *)CGImageSourceCopyPropertiesAtIndex(src, i, NULL); NSDictionary *frameProperties = [properties objectForKey:(NSString *)kCGImagePropertyGIFDictionary]; NSNumber *delayTime = [frameProperties objectForKey:(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; animationTime += [delayTime floatValue]; if (img) { [frames addObject:[UIImage imageWithCGImage:img]]; CGImageRelease(img); } } CFRelease(src); } return frames; }
0 0
- IOS GIF图片解析 将gif图片解析成image数组
- IOS GIF图片解析 将gif图片解析成image数组
- IOS GIF图片的解析
- Gif图片的解析
- 解析gif图得到图片数组
- iOS开发--将gif图片转成数组
- android skia 解析gif图片
- gif 格式图片详细解析
- gif 格式图片详细解析
- gif 格式图片详细解析
- gif格式图片的解析
- gif 格式图片详细解析
- iOS将GIF转变为图片
- iOS中GIF图片的解析+合成
- Android 6.0 利用Fresco解析gif图片
- iOS 图片gif格式转化为数组
- IOS显示GIF图片
- ios播放gif图片
- Android 打包签名(二)
- 打印结点和等于某个值的所有路径
- 使用strace, ltrace寻找故障原因的线索
- linux读取windows共享文件
- Spring Security + Hibernate Annotation Example
- IOS GIF图片解析 将gif图片解析成image数组
- C++ 小技巧
- maven中的pom.xml学习
- Image、BufferImage和ImageIcon关系及用法
- Android SurfaceView实战 带你玩转flabby bird (上)
- C++ 调用Python
- web使用openoffice实现在线预览office文档
- 内存溢出之Tomcat内存配置
- c++多线程同步使用的对象