-1

我想使用以下格式将图像发布到网络服务:

图片=%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%01%00%00%00%01%01%03%00%00%00%25%DBV %CA%00%00%00%04gAMA%00%00%B1%8F%0B%FCa%05%00%00%00%01sRGB%00%AE%CE%1C%E9%00%00%00+cHRM %00%00z%26%00%00%80%84%00%00%FA%00%00%00%80%E8%00%00u0%00%00%EA%60%00%00%3A%98 %00%00%17p%9C%BAQ%3C%00%00%00%06PLTE%11%0B%0C%FF%FF%FFPU%C0J%00%00%00%01tRNS%94%B7%84%8F %3B%00%00%00%01bKGD%01%FF%02-%DE%00%00%00%09pHYs%00%00%00H%00%00%00H%00F%C9k%3E%00%00% 00%0AIDAT%08%D7c%60%00%00%00%02%00%01%E2%21%BC3%00%00%00%25tEXtdate%3Acreate%002013-01-06T12%3A31%3A53%2B02% 3A00%92R%3A%D3%00%00%00%25tEXtdate%3Amodify%002013-01-06T12%3A31%3A53%2B02%3A00%E3%0F%82o%00%00%00%19tEXtSoftware%00Adobe+ImageReadyq% C9e%3C%00%00%00%00IEND%AEB%60%82

我的问题是如何将图像转换为这种格式。

感谢任何帮助。

4

2 回答 2

1

我找到了解决方案。如果有人需要它:

NSData *imageData = UIImagePNGRepresentation(self.photoImageView.image);
NSString *imageStringASCII = [[NSString alloc] initWithData:imageData encoding:NSASCIIStringEncoding];
于 2013-02-14T13:40:21.020 回答
0

将您的图像转换为 Base64,即在以下Base64库的帮助下进行编码

并将图像上传到服务器。在服务器中解码并转换为图像并存储

于 2013-02-13T09:42:39.557 回答