首页 > 代码库 > 图片转base64字符串

图片转base64字符串

图片转base64字符串

by 伍雪颖

- (NSString *)base64String:(UIImage *)image {
    NSData * data = http://www.mamicode.com/[UIImagePNGRepresentation(image) base64EncodedDataWithOptions:NSDataBase64Encoding64CharacterLineLength];>
NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:shareEntity.photoContentStr options:1];
UIImage *image = [UIImage imageWithData:decodedData];


图片转base64字符串