IPA PNG图片转换
2012-06-24 10:55
155 查看
- (void)loadAllBundleImage
{
NSArray * imagesPath = [NSBundle pathsForResourcesOfType:@"png" inDirectory:[[NSBundle mainBundle]bundlePath]];
for (NSString * a in imagesPath) {
NSData * idata =UIImagePNGRepresentation([UIImage imageWithContentsOfFile:a]);
[self writeApplicationData: idata toFile: [a lastPathComponent]];
}
}
- (BOOL)writeApplicationData:(NSData *)data toFile:(NSString *)fileName
{
NSArray *paths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
if (!documentsDirectory) {
NSLog(@"Documents directory not found!");
return NO;
}
NSString *appFile = [documentsDirectory stringByAppendingPathComponent:fileName];
return ([data writeToFile:appFile atomically:YES]);
}
{
NSArray * imagesPath = [NSBundle pathsForResourcesOfType:@"png" inDirectory:[[NSBundle mainBundle]bundlePath]];
for (NSString * a in imagesPath) {
NSData * idata =UIImagePNGRepresentation([UIImage imageWithContentsOfFile:a]);
[self writeApplicationData: idata toFile: [a lastPathComponent]];
}
}
- (BOOL)writeApplicationData:(NSData *)data toFile:(NSString *)fileName
{
NSArray *paths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
if (!documentsDirectory) {
NSLog(@"Documents directory not found!");
return NO;
}
NSString *appFile = [documentsDirectory stringByAppendingPathComponent:fileName];
return ([data writeToFile:appFile atomically:YES]);
}
相关文章推荐
- 拆解ipa 包获取png素材文件
- 修复ipa图片png方法
- app ipa还原png 脚本
- ipa提取png图片,windows下显示黑色
- ios-破解ipa包中的png 图片
- 提取ipa里面的资源图片 png
- ipa解包,还原ipa里的png图片资源
- 修复从 app 包里面抓出的 png 图片的文件头(破解,ipa)II
- ios-破解ipa包中的png 图片
- <UI>还原ipa包中的所有png图片
- 提取ipa中的png资源
- 提取ipa里面的资源图片 png
- 如何从ipa包中获取png图片
- nodejs修复ipa处理过的png图片
- 还原ipa里的png图片资源
- ipa中提取图片资源 png处理方法
- ipa 包中的 PNG 文件的正常化
- 通过压缩png图片的方式减少ipa包的尺寸
- 通过压缩png图片的方式减少ipa包的尺寸
- ios-破解ipa包中的png 图片