UIImage加载图片

来源:互联网 发布:mac word 导航栏 编辑:程序博客网 时间:2024/04/27 16:12

self.image = [UIImageimageWithData:[NSDatadataWithContentsOfURL:[NSURLURLWithString:strFileUrl]]];//通过url加载图片


self.image = [UIImageimageWithData:[[NSData dataWithContentsOfFile:strFileUrl]]];//通过本地文件名加载图片,如果文件名是url字符串,加载不成功

 


UIImageWriteToSavedPhotosAlbum(self.image,nil, nil, nil);将程序中的图片写到本地相册