标签:style blog io color os sp 数据 div on
1.图片转base64串及反转回图片
UIImage图片转成base64字符串:
1 UIImage *_originImage = [UIImage imageNamed:@"full_playlist_hl.png"]; 2 NSData *_data = UIImageJPEGRepresentation(_image, 1.0f);
3 NSString *_encodedImageStr = [_data base64Encoding]; 4 NSLog(@"===Encoded image:\n%@", _encodedImageStr);
Base64字符串转UIImage图片:
1 NSData *_decodedImageData = [[NSData alloc] initWithBase64Encoding:_encodedImageStr]; 2 UIImage *_decodedImage = [UIImage imageWithData:_decodedImageData]; 3 NSLog(@"===Decoded image size: %@", NSStringFromCGSize(_decodedImage.size));
标签:style blog io color os sp 数据 div on
原文地址:http://www.cnblogs.com/lxllanou/p/4072860.html