1 //3.从上下文中取出绘制好的图片2 UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();3 4 NSData *data = UIImagePNGRepresentation(newImage);5 6 NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"abc.png"];7 NSLog(@"%@", path);8 [data writeToFile:path atomically:YES];
原文:http://my.oschina.net/u/2329800/blog/490409