UIImageTobase64EncodedString

二维码的base64字符串转换;通过我们更喜欢传递二维码的信息

Posted by kunnan on June 23, 2018

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