originImage-> encodedImageStr
- encodedImageStr
UIImage *originImage = [self valueForKey:@"m_oQRCodeImage"];
NSData *data = UIImageJPEGRepresentation(originImage, 1.0f);
NSString *encodedImageStr = [data base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
[GACSocketModel stringByReplacingOccurrencesOfString:encodedImageStr];
以其传输二维码的encodedImageStr,还不如直接传输二维码信息
See Also
/Users/devzkn/bin/knpost UIImageTobase64EncodedString 二维码的base64字符串转换;通过我们更喜欢传递二维码的信息 -t objc #原来""的参数,需要自己加上""
- http://imgbase64.duoshitong.com/
转载请注明:张坤楠的博客 > UIImageTobase64EncodedString
-
Previous
CycriptUsefulCommand -
Next
stringByReplacingOccurrencesOfString_substringWithRange_NSRegularExpression