【发布时间】:2012-07-16 06:46:34
【问题描述】:
我有扩展名为 .RGB 的文件,需要在 uiimageview 上显示。
为此,我需要将 .RGB 格式转换为特定格式,如 .PNG 或 .JPEG,但无法正确处理。 我为此尝试了以下代码。
UIImage *image=[UIImage imageNamed:@"Attachment.RGB"];
CGImageRef imageRef=[image CGImage];
UIImage *myImage = [UIImage imageWithCGImage:imageRef];
NSData *pngData = UIImagePNGRepresentation(myImage);
UIImage* imageFinal = [UIImage imageWithData:pngData];
image_view.image=imageFinal;
有一些在线网站可以将 RGB 转换为可见图像。但我没有找到目标 c 的任何解决方案。 谁能帮我解决这个问题。
问候 帕吉伊123
【问题讨论】:
标签: ios4 uiimageview uiimagepngrepresentation