zoukankan      html  css  js  c++  java
  • IPA PNG图片转换

    - (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]);
    }
  • 相关阅读:
    contes配置nginx教程
    jquery 图片放大镜,草稿版
    VUE学习第四次
    VUE学习 第三次
    ryu
    ovs & ryu & mininet
    centos安装mininet 和卸载
    端口镜像
    数据中心网络监控小结
    5、Kafka生产过程分析
  • 原文地址:https://www.cnblogs.com/bandy/p/2559781.html
Copyright © 2011-2022 走看看